Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request nextcloud#43275 from nextcloud/enh/noid/no-excepti…
Browse files Browse the repository at this point in the history
…on-on-missing-key-updatelazy-updatesensitie

return false on AppConfigUnknownKeyException
  • Loading branch information
ArtificialOwl authored Feb 5, 2024
2 parents 3a556ac + 1b2e503 commit f910baf
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/private/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,15 +874,18 @@ public function updateType(string $app, string $key, int $type = self::VALUE_MIX
* @param string $key config key
* @param bool $sensitive TRUE to set as sensitive, FALSE to unset
*
* @return bool TRUE if database update were necessary
* @throws AppConfigUnknownKeyException if config key is not known
* @return bool TRUE if entry was found in database and an update was necessary
* @since 29.0.0
*/
public function updateSensitive(string $app, string $key, bool $sensitive): bool {
$this->assertParams($app, $key);
$this->loadConfigAll();

if ($sensitive === $this->isSensitive($app, $key, null)) {
try {
if ($sensitive === $this->isSensitive($app, $key, null)) {
return false;
}
} catch (AppConfigUnknownKeyException $e) {
return false;
}

Expand Down Expand Up @@ -914,15 +917,18 @@ public function updateSensitive(string $app, string $key, bool $sensitive): bool
* @param string $key config key
* @param bool $lazy TRUE to set as lazy loaded, FALSE to unset
*
* @return bool TRUE if database update was necessary
* @throws AppConfigUnknownKeyException if config key is not known
* @return bool TRUE if entry was found in database and an update was necessary
* @since 29.0.0
*/
public function updateLazy(string $app, string $key, bool $lazy): bool {
$this->assertParams($app, $key);
$this->loadConfigAll();

if ($lazy === $this->isLazy($app, $key)) {
try {
if ($lazy === $this->isLazy($app, $key)) {
return false;
}
} catch (AppConfigUnknownKeyException $e) {
return false;
}

Expand Down

0 comments on commit f910baf

Please sign in to comment.