diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-10-19 23:17:39 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-10-20 15:40:27 +0200 |
commit | ef842ef20a9fb9330173b09c4f889bd2264c8f87 (patch) | |
tree | 4a7c74d08bb9d1bdf3a55d812b4b87bc92302ded | |
parent | 7836a8d8c79dfec97e07214495fd77b39ae8b5e1 (diff) | |
download | nextcloud-server-ef842ef20a9fb9330173b09c4f889bd2264c8f87.tar.gz nextcloud-server-ef842ef20a9fb9330173b09c4f889bd2264c8f87.zip |
Ensure $commands being an array - fixes #26073
-rw-r--r-- | lib/private/App/DependencyAnalyzer.php | 3 | ||||
-rw-r--r-- | tests/lib/App/DependencyAnalyzerTest.php | 1 |
2 files changed, 4 insertions, 0 deletions
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']], ]; } |