Changeset 2333 for FCKpackager/trunk

Show
Ignore:
Timestamp:
2008-08-05 17:30:29 (5 months ago)
Author:
fredck
Message:

The changes made with [2322] where not considering ternary operators. Fixed it.

Files:
1 modified

Legend:

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

    r2322 r2333  
    9393                { 
    9494                        if ( strlen( $var) > 1 ) 
    95                                 $source = preg_replace( '/(?<!\w|\d|\.)' . preg_quote( $var ) . '(?!\w|\d|(?:\s*:))/', $this->_GetVarName(), $source ) ; 
     95                        { 
     96                                $varName = $this->_GetVarName(); 
     97                                $source = preg_replace( '/(?<!\w|\d|\.)' . preg_quote( $var ) . '(?!\w|\d|:)/', $varName, $source ) ; 
     98 
     99                                // The above regex exclude names placed before ":", but it is not true for ternary operators. 
     100                                $source = preg_replace( '/(?<=\?)' . preg_quote( $var ) . '(?=:)/', $varName, $source ) ; 
     101                        } 
    96102                } 
    97103