Skip to content
This repository has been archived by the owner on Feb 23, 2019. It is now read-only.

Commit

Permalink
Closure Compiler: fix JAVA path with spaces #428
Browse files Browse the repository at this point in the history
  • Loading branch information
Furniel authored and szepeviktor committed May 5, 2017
1 parent 0cc9a76 commit 06f283c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Minify/Minify/ClosureCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,14 @@ private static function _getCmd($userOptions, $tmpFile)
),
$userOptions
);
$cmd = self::$javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)

$javaExecutable = self::$javaExecutable;

if( false !== strpos(trim($javaExecutable), ' ') ){
$javaExecutable = '"'.$javaExecutable.'"';
}

$cmd = $javaExecutable . ' -jar ' . escapeshellarg(self::$jarFile)
. (preg_match('/^[\\da-zA-Z0-9\\-]+$/', $o['charset'])
? " --charset {$o['charset']}"
: '');
Expand Down

0 comments on commit 06f283c

Please sign in to comment.