Skip to content

Commit

Permalink
escape argument
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 21, 2020
1 parent e2352f4 commit a5eb210
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Utilities/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Utilities;

use Illuminate\Support\ProcessUtils;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

Expand Down Expand Up @@ -31,14 +32,14 @@ public static function run($string, $all_output = false, $timeout = 0)

public static function getPhpBinary()
{
$bin = (new PhpExecutableFinder)->find(false);
$bin = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));

return !empty($bin) ? $bin : 'php';
}

public static function getArtisanBinary()
{
return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan';
return defined('ARTISAN_BINARY') ? ProcessUtils::escapeArgument(ARTISAN_BINARY) : 'artisan';
}

public static function formatCommandString($string)
Expand Down

0 comments on commit a5eb210

Please sign in to comment.