Changeset 19468
- Timestamp:
- 06/23/09 09:14:37 (8 months ago)
- Files:
-
- branches/1.2/lib/routing/sfRoute.class.php (modified) (2 diffs)
- branches/1.3/lib/routing/sfRoute.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/routing/sfRoute.class.php
r17382 r19468 650 650 $this->options['variable_prefix_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['variable_prefixes'])).')'; 651 651 $this->options['segment_separators_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['segment_separators'])).')'; 652 $this->options['variable_content_regex'] = '[^'.implode('', array_map(create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));'), $this->options['segment_separators'])).']+'; 652 653 // as of PHP 5.3.0, preg_quote automatically quotes dashes "-" (see http://bugs.php.net/bug.php?id=47229) 654 $this->options['variable_content_regex'] = '[^'.implode('', array_map( 655 version_compare(PHP_VERSION, '5.3.0RC4', '>=') ? 656 create_function('$a', 'return preg_quote($a, \'#\');') : 657 create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));') 658 , $this->options['segment_separators'])).']+'; 653 659 } 654 660 … … 755 761 { 756 762 $length = strlen($this->pattern); 757 763 758 764 if ($length > 0 && '/' == $this->pattern[$length - 1]) 759 765 { branches/1.3/lib/routing/sfRoute.class.php
r17403 r19468 650 650 $this->options['variable_prefix_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['variable_prefixes'])).')'; 651 651 $this->options['segment_separators_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['segment_separators'])).')'; 652 $this->options['variable_content_regex'] = '[^'.implode('', array_map(create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));'), $this->options['segment_separators'])).']+'; 652 653 // as of PHP 5.3.0, preg_quote automatically quotes dashes "-" (see http://bugs.php.net/bug.php?id=47229) 654 $this->options['variable_content_regex'] = '[^'.implode('', array_map( 655 version_compare(PHP_VERSION, '5.3.0RC4', '>=') ? 656 create_function('$a', 'return preg_quote($a, \'#\');') : 657 create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));') 658 , $this->options['segment_separators'])).']+'; 653 659 } 654 660 … … 755 761 { 756 762 $length = strlen($this->pattern); 757 763 758 764 if ($length > 0 && '/' == $this->pattern[$length - 1]) 759 765 {

