Skip to content

Commit

Permalink
Merge pull request #44645 from nextcloud/backport/44642/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(appconfig): compare with original value
  • Loading branch information
blizzz authored Apr 11, 2024
2 parents 2617645 + abc4ced commit 40d5495
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ private function setTypedValue(
$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);
}
Expand All @@ -760,7 +761,7 @@ private function setTypedValue(
* 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;
}
Expand Down

0 comments on commit 40d5495

Please sign in to comment.