From 5930298b8948e613a54399d5ba9b0843909b0893 Mon Sep 17 00:00:00 2001 From: Jan Brauer Date: Thu, 16 Jan 2014 12:27:02 +0100 Subject: [PATCH] Fix error code candling, allow ALL options --- min/lib/Minify/FastClosureCompiler.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/min/lib/Minify/FastClosureCompiler.php b/min/lib/Minify/FastClosureCompiler.php index 8897af8..5dd6cc7 100644 --- a/min/lib/Minify/FastClosureCompiler.php +++ b/min/lib/Minify/FastClosureCompiler.php @@ -68,8 +68,9 @@ class Minify_FastClosureCompiler { // broke the connection and returns 227 instead of 0 // We'll just handle this here instead of fixing // the nailgun client itself. - if ($result_code != 0 || $result_code != 227) { + if ($result_code != 0 && $result_code != 227) { throw new Exception('Minify_FastClosureCompiler : Closure Compiler execution failed.'); + } return implode("\n", $output); } @@ -88,10 +89,8 @@ class Minify_FastClosureCompiler { ? " --charset {$o['charset']}" : ''); - foreach (array('compilation_level') as $opt) { - if ($o[$opt]) { - $cmd .= " --{$opt} ". escapeshellarg($o[$opt]); - } + foreach ($o as $key => $value) { + $cmd .= " --{$key} ". escapeshellarg($value); } return $cmd . ' ' . escapeshellarg($tmpFile); }