diff options
Diffstat (limited to 'system/core/Output.php')
-rw-r--r-- | system/core/Output.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 05bc48ed4..5173f7ed8 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -839,7 +839,7 @@ class CI_Output { if ($type === 'js') { // Catch all string literals and comment blocks - if (preg_match_all('#((?:((?<!\\\)\'|")|/\*).*(?(2)(?<!\\\)\2|\*/))#msuUS', $output, $match, PREG_OFFSET_CAPTURE)) + if (preg_match_all('#((?:((?<!\\\)\'|")|(/\*)|(//)).*(?(2)(?<!\\\)\2|(?(3)\*/|\n)))#msuUS', $output, $match, PREG_OFFSET_CAPTURE)) { $js_literals = $js_code = array(); for ($match = $match[0], $c = count($match), $i = $pos = $offset = 0; $i < $c; $i++) @@ -877,7 +877,6 @@ class CI_Output { if ($type === 'js') { $patterns = array( - '#\n?//[^\n]*#' => '', // Remove // line comments '#\s*([!\#%&()*+,\-./:;<=>?@\[\]^`{|}~])\s*#' => '$1', // Remove spaces following and preceeding JS-wise non-special & non-word characters '#\s{2,}#' => ' ' // Reduce the remaining multiple whitespace characters to a single space ); |