[Process] Always escape commands properly and remove windows-specific handling
This commit is contained in:
parent
9e237f6345
commit
c4e8ff75f5
@ -102,20 +102,12 @@ class ProcessBuilder
|
||||
|
||||
$options = $this->options;
|
||||
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||
$options['bypass_shell'] = true;
|
||||
$arguments = $this->arguments;
|
||||
$command = array_shift($arguments);
|
||||
|
||||
$arguments = $this->arguments;
|
||||
$command = array_shift($arguments);
|
||||
|
||||
$script = '"'.$command.'"';
|
||||
if ($arguments) {
|
||||
$script .= ' '.implode(' ', array_map('escapeshellarg', $arguments));
|
||||
}
|
||||
|
||||
$script = 'cmd /V:ON /E:ON /C "'.$script.'"';
|
||||
} else {
|
||||
$script = implode(' ', array_map('escapeshellarg', $this->arguments));
|
||||
$script = escapeshellcmd($command);
|
||||
if ($arguments) {
|
||||
$script .= ' '.implode(' ', array_map('escapeshellarg', $arguments));
|
||||
}
|
||||
|
||||
$env = $this->inheritEnv && $_ENV ? $this->env + $_ENV : $this->env;
|
||||
|
Reference in New Issue
Block a user