File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/Symfony/Component/Process Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1530,14 +1530,15 @@ private function requireProcessIsTerminated(string $functionName)
1530
1530
/**
1531
1531
* Escapes a string to be used as a shell argument.
1532
1532
*/
1533
- private function escapeArgument (string $ argument ): string
1533
+ private function escapeArgument ($ argument ): string
1534
1534
{
1535
+ $ argument = (string ) $ argument ;
1536
+ if ('' === $ argument ) {
1537
+ return '"" ' ;
1538
+ }
1535
1539
if ('\\' !== \DIRECTORY_SEPARATOR ) {
1536
1540
return "' " .str_replace ("' " , "' \\'' " , $ argument )."' " ;
1537
1541
}
1538
- if ('' === $ argument = (string ) $ argument ) {
1539
- return '"" ' ;
1540
- }
1541
1542
if (false !== strpos ($ argument , "\0" )) {
1542
1543
$ argument = str_replace ("\0" , '? ' , $ argument );
1543
1544
}
You can’t perform that action at this time.
0 commit comments