Changeset 2244

Show
Ignore:
Timestamp:
2008-07-21 14:18:36 (6 months ago)
Author:
fredck
Message:

Updated to the latest FCKpackager.

Location:
FCKreleaser/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • FCKreleaser/trunk/fckreleaser.php

    r1977 r2244  
    597597                $script = $stringsProc->ProtectStrings( $script ) ; 
    598598 
     599                // Remove "/* */" comments 
     600                $script = preg_replace( 
     601                        '/(?<!\/)\/\*.*?\*\//s', 
     602                        '', $script ) ; 
     603 
    599604                // Remove "//" comments 
    600605                $script = preg_replace( 
    601                         '/\/\/.*$/m', 
    602                         '', $script ) ; 
    603  
    604                 // Remove "/* */" comments 
    605                 $script = preg_replace( 
    606                         '/(?m-s:^\s*\/\*).*?\*\//s', 
    607                         '', $script ) ; 
    608  
     606                                '/\/\/.*$/m', 
     607                                '', $script ) ; 
     608                 
    609609                // Remove spaces before the ";" at the end of the lines 
    610610                $script = preg_replace( 
     
    990990        function ProtectStrings( $source ) 
    991991        { 
     992                // Catches string literals, regular expressions and conditional comments. 
    992993                return preg_replace_callback( 
    993                         '/(?:("|\').*?(?<!\\\\)\1|(?<![\/\\\\])\/[^\/\*].*?(?<!\\\\)\/)/', 
     994                        '/(?:("|\').*?(?<!\\\\)\1)|(?:(?<![\*\/\\\\])\/[^\/\*].*?(?<!\\\\)\/(?=([\.\w])|(\s*[,;}\)])))|(?s:\/\*@(?:cc_on|if|elif|else|end).*?@\*\/)/', 
    994995                        array( &$this, '_ProtectStringsMatch' ), $source ) ; 
    995996        }