diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2024-02-01 19:48:40 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2024-02-01 21:51:17 -0100 |
commit | 1b2e503e7f1f9837da63bdcd3ce5bf5574af90cb (patch) | |
tree | 7ec8bb6bf91109c323f6a649fe42c1ec84770d30 /lib/private/AppConfig.php | |
parent | 17ee5968263a5bb96f4ca1d50845ad06066f8062 (diff) | |
download | nextcloud-server-1b2e503e7f1f9837da63bdcd3ce5bf5574af90cb.tar.gz nextcloud-server-1b2e503e7f1f9837da63bdcd3ce5bf5574af90cb.zip |
return false on AppConfigUnknownKeyException
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/private/AppConfig.php')
-rw-r--r-- | lib/private/AppConfig.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 8064fe186f8..07eebf1d047 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -874,15 +874,18 @@ class AppConfig implements IAppConfig { * @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; } @@ -914,15 +917,18 @@ class AppConfig implements IAppConfig { * @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; } |