Skip to content

Commit d4ef74e

Browse files
authored
Refactor command argument escaping to use ProcessUtils for improved safety (#378)
1 parent d6127a3 commit d4ef74e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

overrides/Runner/Parallel/ProcessFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* THE SOFTWARE.
3737
*/
3838

39+
use Illuminate\Support\ProcessUtils;
3940
use PhpCsFixer\Runner\RunnerConfig;
4041
use React\EventLoop\LoopInterface;
4142
use Symfony\Component\Console\Input\InputInterface;
@@ -118,7 +119,7 @@ public function getCommandArgs(int $serverPort, ProcessIdentifier $identifier, R
118119

119120
if ($optionValue !== null) {
120121
$commandArgs[] = "--{$option}";
121-
$commandArgs[] = escapeshellarg($optionValue);
122+
$commandArgs[] = ProcessUtils::escapeArgument($optionValue);
122123
}
123124
}
124125

0 commit comments

Comments
 (0)