Skip to content
Snippets Groups Projects
Unverified Commit ef842ef2 authored by Thomas Müller's avatar Thomas Müller Committed by Morris Jobke
Browse files

Ensure $commands being an array - fixes #26073

parent 7836a8d8
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -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']],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment