File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/Symfony/Component/Process Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1530,14 +1530,14 @@ 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 (? string $ argument ): string
1534
1534
{
1535
+ if ('' === $ argument || null === $ argument ) {
1536
+ return '"" ' ;
1537
+ }
1535
1538
if ('\\' !== \DIRECTORY_SEPARATOR ) {
1536
1539
return "' " .str_replace ("' " , "' \\'' " , $ argument )."' " ;
1537
1540
}
1538
- if ('' === $ argument = (string ) $ argument ) {
1539
- return '"" ' ;
1540
- }
1541
1541
if (false !== strpos ($ argument , "\0" )) {
1542
1542
$ argument = str_replace ("\0" , '? ' , $ argument );
1543
1543
}
You can’t perform that action at this time.
0 commit comments