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.
This commit is contained in:
michaelletzgus 2018-02-04 15:59:23 +01:00 committed by Roeland Jago Douma
parent ca162e71d7
commit e1762998b3
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 3 deletions

View File

@ -293,9 +293,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;
}
}
}