Commit 3f9d9d78 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

Merge pull request #26423 from owncloud/fix-dependency-analyser-commands-array

Ensure $commands being an array
parents 20a3f500 a3c7ffae
......@@ -196,6 +196,9 @@ class DependencyAnalyzer {
if (!is_array($commands)) {
$commands = [$commands];
}
if (isset($commands['@value'])) {
$commands = [$commands];
}
$os = $this->platform->getOS();
foreach ($commands as $command) {
if (isset($command['@attributes']['os']) && $command['@attributes']['os'] !== $os) {
......
......@@ -268,6 +268,7 @@ class DependencyAnalyzerTest extends TestCase {
[[], [['@attributes' => ['os' => 'Windows'], '@value' => 'grepp']]],
// grep is known on all systems
[[], 'grep'],
[[], ['@attributes' => ['os' => 'Linux'], '@value' => 'grep']],
];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment