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:
Fabien Potencier 2012-03-22 14:07:25 +01:00
commit d872ad54fa
1 changed files with 1 additions and 7 deletions

View File

@ -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;