Show
Ignore:
Timestamp:
2008-07-21 12:23:35 (6 months ago)
Author:
fredck
Message:

Fixed #1242 and #1343 : Comments are now properly stripped from the code but conditional comments, which are now properly preserved.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKpackager/trunk/_source/includes/fckstringsprocessor.inc

    r2078 r2237  
    3232        function ProtectStrings( $source ) 
    3333        { 
     34                // Catches string literals, regular expressions and conditional comments. 
    3435                return preg_replace_callback( 
    35                         '/(?:("|\').*?(?<!\\\\)\1|(?<![\/\\\\])\/[^\/\*].*?(?<!\\\\)\/)/', 
     36                        '/(?:("|\').*?(?<!\\\\)\1)|(?:(?<![\*\/\\\\])\/[^\/\*].*?(?<!\\\\)\/(?!\s+[\w\d])(?=.*;))|(?s:\/\*@(?:cc_on|if|elif|else|end).*?@\*\/)/', 
    3637                        array( &$this, '_ProtectStringsMatch' ), $source ) ; 
    3738        }