Skip to content
This repository was archived by the owner on Nov 29, 2020. It is now read-only.

Commit 20990dc

Browse files
adaamztm-adaamz
authored andcommitted
Executable: EscapeShellArg in exec method
1 parent 664ec60 commit 20990dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Executable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(string $program, string $cwd)
2222

2323
public function exec(string $command, string ...$args): string
2424
{
25-
$commandLine = $this->executable . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args));
25+
$commandLine = escapeshellarg($this->executable) . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args));
2626
$process = new Process($commandLine, $this->cwd);
2727
$process->mustRun();
2828
return $process->getOutput() . $process->getErrorOutput();

0 commit comments

Comments
 (0)