aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-02-05 16:21:02 -0100
committerGitHub <noreply@github.com>2024-02-05 16:21:02 -0100
commitf910baf9f71ef17de4c344700da66899ec917365 (patch)
treeb79fbf3a723e152f89e3afb2665877f7aea61993 /lib
parent3a556ace05d5956d4d7eaf38739e87fb79f9e9c8 (diff)
parent1b2e503e7f1f9837da63bdcd3ce5bf5574af90cb (diff)
downloadnextcloud-server-f910baf9f71ef17de4c344700da66899ec917365.tar.gz
nextcloud-server-f910baf9f71ef17de4c344700da66899ec917365.zip
Merge pull request #43275 from nextcloud/enh/noid/no-exception-on-missing-key-updatelazy-updatesensitie
return false on AppConfigUnknownKeyException
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppConfig.php18
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;
}