Skip to content

Commit

Permalink
Merge pull request #44642 from nextcloud/fix/noid/compare-sensitive-data
Browse files Browse the repository at this point in the history
fix(appconfig): compare with original value
  • Loading branch information
ArtificialOwl authored Apr 4, 2024
2 parents 7dad12e + a643a71 commit 908d7a5
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 908d7a5

Please sign in to comment.