From f57ecc141e072473c73630af29ffe06be25e850c Mon Sep 17 00:00:00 2001 From: judge Date: Tue, 10 Sep 2013 16:18:14 +0200 Subject: Remove Javascript inline comments + improved detecting whether the pointer is in a string or not --- system/core/Output.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Output.php b/system/core/Output.php index 5272ba662..ec82ae7e8 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -856,14 +856,14 @@ class CI_Output { $in_string = $in_dstring = FALSE; $len = strlen($line); for ($i=0; $i<$len; $i++){ - if ( !$in_string && !$in_dstring && substr($line,$i,2)==='//'){ + if ( ! $in_string && ! $in_dstring && substr($line,$i,2) === '//'){ $line = substr($line,0,$i); break; } - if ( $line[$i]==='"' ) - $in_dstring = ! $in_dstring; - if ( $line[$i]==="'" ) + if ( $line[$i]==="'" && ! $in_dstring ) $in_string = ! $in_string; + else if ( $line[$i]==='"' && ! $in_string ) + $in_dstring = ! $in_dstring; } } $output = implode("\n",$lines); -- cgit v1.2.3-24-g4f1b