diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppConfig.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index e8192530c17..a6c92351a97 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -164,7 +164,11 @@ class AppConfig implements IAppConfig { $this->assertParams($app, $key); $this->loadConfig($lazy); - return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key')); + if (!isset($this->valueTypes[$app][$key])) { + throw new AppConfigUnknownKeyException('unknown config key'); + } + + return $this->isTyped(self::VALUE_SENSITIVE, $this->valueTypes[$app][$key]); } /** @@ -955,10 +959,14 @@ class AppConfig implements IAppConfig { $typeString = (string)$type; } + if (!isset($cache[$app][$key])) { + throw new AppConfigUnknownKeyException('unknown config key'); + } + return [ 'app' => $app, 'key' => $key, - 'value' => $cache[$app][$key] ?? throw new AppConfigUnknownKeyException('unknown config key'), + 'value' => $cache[$app][$key], 'type' => $type, 'lazy' => $lazy, 'typeString' => $typeString, |