Skip to content

Fix "undefined index" problem - #8173

Merged
MorrisJobke merged 2 commits into
nextcloud:masterfrom
michaelletzgus:fix_for_each
Feb 6, 2018
Merged

Fix "undefined index" problem#8173
MorrisJobke merged 2 commits into
nextcloud:masterfrom
michaelletzgus:fix_for_each

Conversation

@michaelletzgus

Copy link
Copy Markdown
Contributor

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.

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.
@michaelletzgusmichaelletzgus changed the title Fix undefined index problemFix "undefined index" problemFeb 4, 2018
nickvergessen
nickvergessen previously requested changes Feb 4, 2018
Comment threadlib/private/AppConfig.php Outdated
foreach ($this->sensitiveValues[$app] as $sensitiveKey) {
if (isset($values[$sensitiveKey])) {
$values[$sensitiveKey] = IConfig::SENSITIVE_VALUE;
if (array_key_exists($app, $this->sensitiveValues)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use isset() instead 😃

using isset() instead of array_key_exists()
@codecov

codecovBot commented Feb 5, 2018

Copy link
Copy Markdown

Codecov Report

Merging #8173 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@ Coverage Diff @@## master #8173 +/- ##
============================================
- Coverage 51.73% 51.73% -0.01% - Complexity 25357 25358 +1 
============================================
Files 1598 1598 Lines 95021 95022 +1 Branches 1376 1376 ============================================
- Hits 49159 49155 -4 - Misses 45862 45867 +5
Impacted FilesCoverage ΔComplexity Δ
lib/private/AppConfig.php98.13% <100%> (+0.01%)31 <0> (+1)⬆️
lib/private/Security/CertificateManager.php91% <0%> (-1%)39% <0%> (ø)
core/js/js.js65.74% <0%> (-0.56%)0% <0%> (ø)
lib/private/Server.php83.82% <0%> (+0.09%)281% <0%> (ø)⬇️

@MorrisJobke
MorrisJobke merged commit 8fa86bf into nextcloud:masterFeb 6, 2018
@michaelletzgus
michaelletzgus deleted the fix_for_each branch February 7, 2018 12:27
@MorrisJobke

Copy link
Copy Markdown
Member

Backport is in #8693

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@michaelletzgus@MorrisJobke@nickvergessen