From 466bda383582efba60312709690e89752f9dd959 Mon Sep 17 00:00:00 2001 From: Nigro Simone Date: Mon, 27 Feb 2017 21:06:28 +0100 Subject: [PATCH] Fix for Empty JAVA executable path and JAVA path with spaces (#426) --- lib/Minify/Minify/YUICompressor.php | 9 ++++++++- pub/js/options.js | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/Minify/Minify/YUICompressor.php b/lib/Minify/Minify/YUICompressor.php index 133a37d..9a16452 100644 --- a/lib/Minify/Minify/YUICompressor.php +++ b/lib/Minify/Minify/YUICompressor.php @@ -125,7 +125,14 @@ private static function _getCmd($userOptions, $type, $tmpFile) ) ,$userOptions ); - $cmd = self::$javaExecutable + + $javaExecutable = self::$javaExecutable; + + if( false !== strpos(trim($javaExecutable), ' ') ){ + $javaExecutable = '"'.$javaExecutable.'"'; + } + + $cmd = $javaExecutable . (!empty($o['stack-size']) ? ' -Xss' . $o['stack-size'] : '') diff --git a/pub/js/options.js b/pub/js/options.js index 5ef8239..2f2fbf5 100644 --- a/pub/js/options.js +++ b/pub/js/options.js @@ -1153,24 +1153,24 @@ jQuery(function() { case 'yuijs': jQuery.extend(params, { engine: 'yuijs', - path_java: jQuery('#minify__yuijs__path__java').val(), - path_jar: jQuery('#minify__yuijs__path__jar').val() + path_java: jQuery('#minify_yuijs_path_java').val(), + path_jar: jQuery('#minify_yuijs_path_jar').val() }); break; case 'yuicss': jQuery.extend(params, { engine: 'yuicss', - path_java: jQuery('#minify__yuicss__path__java').val(), - path_jar: jQuery('#minify__yuicss__path__jar').val() + path_java: jQuery('#minify_yuicss_path_java').val(), + path_jar: jQuery('#minify_yuicss_path_jar').val() }); break; case 'ccjs': jQuery.extend(params, { engine: 'ccjs', - path_java: jQuery('#minify__ccjs__path__java').val(), - path_jar: jQuery('#minify__ccjs__path__jar').val() + path_java: jQuery('#minify_ccjs_path_java').val(), + path_jar: jQuery('#minify_ccjs_path_jar').val() }); break; case 'googleccjs':