Ticket #1422: 1422_2.patch
File 1422_2.patch, 1.7 KB (added by , 15 years ago) |
---|
-
_source/includes/fckfunctionprocessor.inc
56 56 if ( !$this->_IsGlobal ) 57 57 $processed = $this->_ProcessVars( $processed, $this->_Parameters ) ; 58 58 59 $numVarMatches = preg_match_all( '/\bvar\b\s+( [\w_][\w\d_]+)/', $processed, $varsMatches ) ;60 59 $numVarMatches = preg_match_all( '/\bvar\b\s+(.+?)(?=;)/', $processed, $varsMatches ) ; 60 61 61 if ( $numVarMatches > 0 ) 62 62 { 63 63 $vars = array() ; 64 64 65 65 for ( $i = 0 ; $i < $numVarMatches ; $i++ ) 66 66 { 67 $vars[] = $varsMatches[1][$i] ; 67 $numVarNameMatches = preg_match_all( '/(?:^|,)\s*([^\s=,]+)/', $varsMatches[1][$i], $varNameMatches ) ; 68 69 for ( $j = 0 ; $j < $numVarNameMatches ; $j++ ) 70 { 71 $vars[] = $varNameMatches[1][$j] ; 72 } 68 73 } 69 74 70 75 $processed = $this->_ProcessVars( $processed, $vars ) ; … … 78 83 foreach ( $vars as $var ) 79 84 { 80 85 if ( strlen( $var) > 1 ) 81 $source = preg_replace( '/(?<!\w|\d|\.)' . $var. '(?!\w|\d)/', $this->_GetVarName(), $source ) ;86 $source = preg_replace( '/(?<!\w|\d|\.)' . preg_quote( $var ) . '(?!\w|\d)/', $this->_GetVarName(), $source ) ; 82 87 } 83 88 84 89 return $source ; … … 94 99 95 100 $var = $this->_VarPrefix . $this->_VarChars[ $this->_LastCharIndex++ ] ; 96 101 97 if ( preg_match( '/(?<!\w|\d|\.)' . $var. '(?!\w|\d)/', $this->_Function ) )102 if ( preg_match( '/(?<!\w|\d|\.)' . preg_quote( $var ) . '(?!\w|\d)/', $this->_Function ) ) 98 103 return $this->_GetVarName() ; 99 104 else 100 105 return $var ; … … 116 121 } 117 122 } 118 123 119 ?> 120 No newline at end of file 124 ?>