8000 [Process] Always escape commands properly and remove windows-specific… · symfony/symfony@c4e8ff7 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4e8ff7

Browse files
committed
[Process] Always escape commands properly and remove windows-specific handling
1 parent 9e237f6 commit c4e8ff7

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/Symfony/Component/Process/ProcessBuilder.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,12 @@ public function getProcess()
102102

103103
$options = $this->options;
104104

105-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
106-
$options['bypass_shell'] = true;
105+
$arguments = $this->arguments;
106+
$command = array_shift($arguments);
107107

108-
$arguments = $this->arguments;
109-
$command = array_shift($arguments);
110-
111-
$script = '"'.$command.'"';
112-
if ($arguments) {
113-
$script .= ' '.implode(' ', array_map('escapeshellarg', $arguments));< 8949 /div>
114-
}
115-
116-
$script = 'cmd /V:ON /E:ON /C "'.$script.'"';
117-
} else {
118-
$script = implode(' ', array_map('escapeshellarg', $this->arguments));
108+
$script = escapeshellcmd($command);
109+
if ($arguments) {
110+
$script .= ' '.implode(' ', array_map('escapeshellarg', $arguments));
119111
}
120112

121113
$env = $this->inheritEnv && $_ENV ? $this->env + $_ENV : $this->env;

0 commit comments

Comments
 (0)
0