From e1762998b3a7a453b033340c62a3915b7288a95d Mon Sep 17 00:00:00 2001 From: michaelletzgus Date: Sun, 4 Feb 2018 15:59:23 +0100 Subject: [PATCH] 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. --- lib/private/AppConfig.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 4e102522550b8..10dc656e5cb1e 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -293,9 +293,11 @@ public function getValues($app, $key) { 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; + } } }