From ba0385b42201920a99a256ec73bf16217cbad09c Mon Sep 17 00:00:00 2001 From: CZechBoY Date: Sat, 12 May 2018 23:28:46 +0200 Subject: [PATCH] Executable: EscapeShellArg in exec method --- src/Executable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Executable.php b/src/Executable.php index be44301..c267f66 100644 --- a/src/Executable.php +++ b/src/Executable.php @@ -22,7 +22,7 @@ public function __construct(string $program, string $cwd) public function exec(string $command, string ...$args): string { - $commandLine = $this->executable . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args)); + $commandLine = escapeshellarg($this->executable) . ' ' . $command . ' ' . implode(' ', array_map('escapeshellarg', $args)); $process = new Process($commandLine, $this->cwd); $process->mustRun(); return $process->getOutput() . $process->getErrorOutput();