File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1638,7 +1638,7 @@ private function escapeArgument(?string $argument): string
1638
1638
if (str_contains ($ argument , "\0" )) {
1639
1639
$ argument = str_replace ("\0" , '? ' , $ argument );
1640
1640
}
1641
- if (!preg_match ('/[\/ ()%!^"<>&|\s]/ ' , $ argument )) {
1641
+ if (!preg_match ('/[()%!^"<>&|\s]/ ' , $ argument )) {
1642
1642
return $ argument ;
1643
1643
}
1644
1644
$ argument = preg_replace ('/( \\\\+)$/ ' , '$1$1 ' , $ argument );
Original file line number Diff line number Diff line change @@ -1424,7 +1424,12 @@ public function testGetCommandLine()
1424
1424
{
1425
1425
$ p = new Process (['/usr/bin/php ' ]);
1426
1426
1427
- $ expected = '\\' === \DIRECTORY_SEPARATOR ? '"/usr/bin/php" ' : "'/usr/bin/php' " ;
1427
+ $ expected = '\\' === \DIRECTORY_SEPARATOR ? '/usr/bin/php ' : "'/usr/bin/php' " ;
1428
+ $ this ->assertSame ($ expected , $ p ->getCommandLine ());
1429
+
1430
+ $ p = new Process (['cd ' , '/d ' ]);
1431
+
1432
+ $ expected = '\\' === \DIRECTORY_SEPARATOR ? 'cd /d ' : "'cd' '/d' " ;
1428
1433
$ this ->assertSame ($ expected , $ p ->getCommandLine ());
1429
1434
}
1430
1435
You can’t perform that action at this time.
0 commit comments