merged branch Seldaek/process_esc (PR #3631)
Commits
-------
da3a2c4
[Process] Fix command escaping
Discussion
----------
[Process] Fix command escaping
My bad, I misunderstood what escapeshellcmd was good for. This fixes it by properly escaping all args.
The test suite hangs here but it already did before, so I'm not sure if all tests pass.
This commit is contained in:
commit
d872ad54fa
@ -103,13 +103,7 @@ class ProcessBuilder
|
||||
|
||||
$options = $this->options;
|
||||
|
||||
$arguments = $this->arguments;
|
||||
$command = array_shift($arguments);
|
||||
|
||||
$script = escapeshellcmd($command);
|
||||
if ($arguments) {
|
||||
$script .= ' '.implode(' ', array_map('escapeshellarg', $arguments));
|
||||
}
|
||||
$script = implode(' ', array_map('escapeshellarg', $this->arguments));
|
||||
|
||||
if ($this->inheritEnv) {
|
||||
$env = $this->env ? $this->env + $_ENV : null;
|
||||
|
Reference in New Issue
Block a user