diff options
author | michaelletzgus <michaelletzgus@users.noreply.github.com> | 2018-02-04 15:59:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 15:59:23 +0100 |
commit | cfa694ea73d128415ce5ebf446a8bb1f8799dcd1 (patch) | |
tree | a63f8494b263c6aa5071a848ce8b2234702313c2 | |
parent | 58b568fd5d5f2185db7874fdea2a4160ce915ae2 (diff) | |
download | nextcloud-server-cfa694ea73d128415ce5ebf446a8bb1f8799dcd1.tar.gz nextcloud-server-cfa694ea73d128415ce5ebf446a8bb1f8799dcd1.zip |
Fix undefined index problem
Nextcloud 13RC4, error in logfile, triggered by "occ config:list":
Invalid argument supplied for foreach() at lib/private/AppConfig.php#297
PHP Undefined index: workflowengine at lib/private/AppConfig.php#297
Fix: Check if index exists in array before using it.
-rw-r--r-- | lib/private/AppConfig.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 59a340cb491..880bf647469 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -288,9 +288,11 @@ class AppConfig implements IAppConfig { public function getFilteredValues($app) { $values = $this->getValues($app, false); - foreach ($this->sensitiveValues[$app] as $sensitiveKey) { - if (isset($values[$sensitiveKey])) { - $values[$sensitiveKey] = IConfig::SENSITIVE_VALUE; + if (array_key_exists($app, $this->sensitiveValues)) { + foreach ($this->sensitiveValues[$app] as $sensitiveKey) { + if (isset($values[$sensitiveKey])) { + $values[$sensitiveKey] = IConfig::SENSITIVE_VALUE; + } } } |