Unverified Commit a3c7ffae authored by Thomas Müller's avatar Thomas Müller
Browse files

Ensure $commands being an array - fixes #26073

parent d322d9b8
......@@ -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