Merge pull request #44642 from nextcloud/fix/noid/compare-sensitive-data

fix(appconfig): compare with original value
pull/44651/head
Maxence Lange 2024-04-04 06:29:13 +07:00 committed by GitHub
commit 908d7a5fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

@ -751,6 +751,7 @@ class AppConfig implements IAppConfig {
$sensitive = $this->isTyped(self::VALUE_SENSITIVE, $type);
$inserted = $refreshCache = false;
$origValue = $value;
if ($sensitive || ($this->hasKey($app, $key, $lazy) && $this->isSensitive($app, $key, $lazy))) {
$value = self::ENCRYPTION_PREFIX . $this->crypto->encrypt($value);
}
@ -760,7 +761,7 @@ class AppConfig implements IAppConfig {
* no update if key is already known with set lazy status and value is
* not different, unless sensitivity is switched from false to true.
*/
if ($value === $this->getTypedValue($app, $key, $value, $lazy, $type)
if ($origValue === $this->getTypedValue($app, $key, $value, $lazy, $type)
&& (!$sensitive || $this->isSensitive($app, $key, $lazy))) {
return false;
}