Merge pull request #44645 from nextcloud/backport/44642/stable29

[stable29] fix(appconfig): compare with original value
This commit is contained in:
Arthur Schiwon 2024-04-11 15:13:32 +02:00 committed by GitHub
commit 40d5495d05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}