diff --git a/src/Minify.php b/src/Minify.php index 58f4b92..ba56abf 100644 --- a/src/Minify.php +++ b/src/Minify.php @@ -318,7 +318,7 @@ protected function extractStrings($chars = '\'"') $minifier = $this; $callback = function ($match) use ($minifier) { // check the second index here, because the first always contains a quote - if (!$match[2]) { + if ($match[2] === '') { /* * Empty strings need no placeholder; they can't be confused for * anything else anyway. diff --git a/tests/js/JSTest.php b/tests/js/JSTest.php index bfab813..875f1c7 100644 --- a/tests/js/JSTest.php +++ b/tests/js/JSTest.php @@ -679,6 +679,12 @@ function isJSON(){str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[ 'if(!0){if(!0)console.log("test")}', ); + // https://github.com/matthiasmullie/minify/issues/99 + $tests[] = array( + '"object";"object2";"0";"1"', + '"object";"object2";"0";"1"', + ); + //update tests' expected results for cross-system compatibility foreach ($tests as &$test) { if (!empty($test[1])) {