Development

Changeset 7603

You must first sign up to be able to contribute.

Changeset 7603

Show
Ignore:
Timestamp:
02/25/08 12:09:37 (7 months ago)
Author:
fabien
Message:

fixed preg_quote usage in sfCache

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/cache/sfCache.class.php

    r6365 r7603  
    221221  protected function patternToRegexp($pattern) 
    222222  { 
    223     $regexp = '#^'.str_replace('#', '\\#', preg_quote($pattern)).'$#'; 
    224  
    225     // ** 
    226     $regexp = str_replace('\\*\\*', '.+?', $regexp); 
    227  
    228     // * 
    229     $regexp = str_replace('\\*', '[^'.preg_quote(sfCache::SEPARATOR).']+', $regexp); 
    230  
    231     return $regexp; 
     223    $regexp = str_replace( 
     224      array('\\*\\*', '\\*'), 
     225      array('.+?',    '[^'.preg_quote(sfCache::SEPARATOR, '#').']+'), 
     226      preg_quote($pattern, '#') 
     227    ); 
     228 
     229    return '#^'.$regexp.'$#'; 
    232230  } 
    233231}