Remove Process::escapeArgument argument type hint
This commit is contained in:
parent
5bd240314c
commit
acf8b8338a
@ -1530,14 +1530,14 @@ class Process implements \IteratorAggregate
|
|||||||
/**
|
/**
|
||||||
* Escapes a string to be used as a shell argument.
|
* Escapes a string to be used as a shell argument.
|
||||||
*/
|
*/
|
||||||
private function escapeArgument(string $argument): string
|
private function escapeArgument(?string $argument): string
|
||||||
{
|
{
|
||||||
|
if ('' === $argument || null === $argument) {
|
||||||
|
return '""';
|
||||||
|
}
|
||||||
if ('\\' !== \DIRECTORY_SEPARATOR) {
|
if ('\\' !== \DIRECTORY_SEPARATOR) {
|
||||||
return "'".str_replace("'", "'\\''", $argument)."'";
|
return "'".str_replace("'", "'\\''", $argument)."'";
|
||||||
}
|
}
|
||||||
if ('' === $argument = (string) $argument) {
|
|
||||||
return '""';
|
|
||||||
}
|
|
||||||
if (false !== strpos($argument, "\0")) {
|
if (false !== strpos($argument, "\0")) {
|
||||||
$argument = str_replace("\0", '?', $argument);
|
$argument = str_replace("\0", '?', $argument);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user