Skip to content

Commit 17caaf4

Browse files
committed
Fix check for = before splitting string
1 parent 70b3c4f commit 17caaf4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Commands/Services/StatusCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
1717
use function array_key_exists;
18+
use function dump;
1819
use function explode;
1920
use function implode;
2021
use function parse_url;
@@ -150,8 +151,11 @@ private function getLabelsFromString(string $string): MutableCollection
150151
$labels = new MutableCollection();
151152

152153
foreach (explode(',', $string) as $label) {
153-
[$key, $value] = explode('=', $label);
154-
$labels->set($key, $value);
154+
if (false !== strpos($label, '=')) {
155+
[$key, $value] = explode('=', $label);
156+
157+
$labels->set($key, $value);
158+
}
155159
}
156160

157161
return $labels;

0 commit comments

Comments
 (0)