diff options
author | judge <mjnaderi@gmail.com> | 2013-09-10 16:18:14 +0200 |
---|---|---|
committer | judge <mjnaderi@gmail.com> | 2013-09-10 16:18:14 +0200 |
commit | f57ecc141e072473c73630af29ffe06be25e850c (patch) | |
tree | 0b48a4fe1af286b2f937caae41d7a6db817da0db | |
parent | 855f91759d383aadc8e1a4fee675c4afb59305cf (diff) |
Remove Javascript inline comments + improved detecting whether the pointer is in a string or not
-rw-r--r-- | system/core/Output.php | 8 |
1 files 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); |