summaryrefslogtreecommitdiffstats
path: root/system/core/Output.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-10-31 15:07:40 +0100
committerAndrey Andreev <narf@devilix.net>2013-10-31 15:07:40 +0100
commit0949b36c3ebb10732223ddc890e1a41c015aa086 (patch)
tree5a2b066f8e989c4d60c61c191f6c1762ebb9add2 /system/core/Output.php
parent0c51847e0afc94b145104b415adb72cb4143dbd6 (diff)
Fix #2710
Diffstat (limited to 'system/core/Output.php')
-rw-r--r--system/core/Output.php3
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
);