From ef842ef20a9fb9330173b09c4f889bd2264c8f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu> Date: Wed, 19 Oct 2016 23:17:39 +0200 Subject: [PATCH] Ensure $commands being an array - fixes #26073 --- lib/private/App/DependencyAnalyzer.php | 3 +++ tests/lib/App/DependencyAnalyzerTest.php | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/private/App/DependencyAnalyzer.php b/lib/private/App/DependencyAnalyzer.php index 7adb5d1c574..7b48e81f3eb 100644 --- a/lib/private/App/DependencyAnalyzer.php +++ b/lib/private/App/DependencyAnalyzer.php @@ -197,6 +197,9 @@ class DependencyAnalyzer { if (!is_array($commands)) { $commands = array($commands); } + if (isset($commands['@value'])) { + $commands = [$commands]; + } $os = $this->platform->getOS(); foreach ($commands as $command) { if (isset($command['@attributes']['os']) && $command['@attributes']['os'] !== $os) { diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index eb1142afd9d..091479798b3 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -266,6 +266,7 @@ class DependencyAnalyzerTest extends TestCase { [[], [['@attributes' => ['os' => 'Windows'], '@value' => 'grepp']]], // grep is known on all systems [[], 'grep'], + [[], ['@attributes' => ['os' => 'Linux'], '@value' => 'grep']], ]; } -- GitLab