Changeset 12968
- Timestamp:
- 11/13/08 11:56:43 (8 months ago)
- Files:
-
- branches/1.2/lib/routing/sfRoute.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/routing/sfRoute.class.php
r12661 r12968 453 453 while (strlen($buffer)) 454 454 { 455 if ($afterASeparator && preg_match('#^'.$this->options['variable_prefix_regex'].'('.$this->options['variable_regex'].')#', $buffer, $match)) 455 if (false !== $this->tokenizeBufferBefore($buffer, $tokens, $afterASeparator, $currentSeparator)) 456 { 457 } 458 else if ($afterASeparator && preg_match('#^'.$this->options['variable_prefix_regex'].'('.$this->options['variable_regex'].')#', $buffer, $match)) 456 459 { 457 460 // a variable … … 480 483 $afterASeparator = true; 481 484 } 485 else if (false !== $this->tokenizeBufferAfter($buffer, $tokens, $afterASeparator, $currentSeparator)) 486 { 487 } 482 488 else 483 489 { 484 if (false === $this->tokenizeBuffer($buffer, $tokens, $afterASeparator, $currentSeparator)) 485 { 486 // parsing problem 487 throw new InvalidArgumentException(sprintf('Unable to parse "%s" route near "%s".', $this->pattern, $buffer)); 488 } 489 } 490 } 491 } 492 493 protected function tokenizeBuffer(&$buffer, &$tokens, &$afterASeparator, &$currentSeparator) 490 // parsing problem 491 throw new InvalidArgumentException(sprintf('Unable to parse "%s" route near "%s".', $this->pattern, $buffer)); 492 } 493 } 494 } 495 496 protected function tokenizeBufferBefore(&$buffer, &$tokens, &$afterASeparator, &$currentSeparator) 497 { 498 return false; 499 } 500 501 protected function tokenizeBufferAfter(&$buffer, &$tokens, &$afterASeparator, &$currentSeparator) 494 502 { 495 503 return false;

