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 Morris Jobke
parent a637e0d686
commit 7e651ffd54
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
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;
}
}
}