File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/Symfony/Component/Process Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1638,7 +1638,7 @@ private function escapeArgument(?string $argument): string
16381638 if (str_contains ($ argument , "\0" )) {
16391639 $ argument = str_replace ("\0" , '? ' , $ argument );
16401640 }
1641- if (!preg_match ('/[\/ ()%!^"<>&|\s]/ ' , $ argument )) {
1641+ if (!preg_match ('/[()%!^"<>&|\s]/ ' , $ argument )) {
16421642 return $ argument ;
16431643 }
16441644 $ argument = preg_replace ('/( \\\\+)$/ ' , '$1$1 ' , $ argument );
Original file line number Diff line number Diff line change @@ -1426,6 +1426,11 @@ public function testGetCommandLine()
14261426
14271427 $ expected = '\\' === \DIRECTORY_SEPARATOR ? '"/usr/bin/php" ' : "'/usr/bin/php' " ;
14281428 $ this ->assertSame ($ expected , $ p ->getCommandLine ());
1429+
1430+ $ p = new Process (['cd ' , '/d ' ]);
1431+
1432+ $ expected = '\\' === \DIRECTORY_SEPARATOR ? 'cd /d ' : "'cd' '/d' " ;
1433+ $ this ->assertSame ($ expected , $ p ->getCommandLine ());
14291434 }
14301435
14311436 /**
You can’t perform that action at this time.
0 commit comments