Fixed small Router bug in previous commit

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6649 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
the_undefined 2008-04-09 19:07:02 +00:00
parent 0c125f362e
commit f51f051bc2

View file

@ -313,12 +313,13 @@ class Router extends Object {
} elseif ($element == '*') {
$parsed[] = '(?:/(.*))?';
} else if ($namedParam && preg_match_all('/(?!\\\\):([a-z_0-9]+)/i', $element, $matches)) {
$matchCount = count($matches[1]);
foreach ($matches[1] as $i => $name) {
$pos = strpos($element, ':' . $name);
$before = substr($element, 0, $pos);
$element = substr($element, $pos+strlen($name)+1);
$after = null;
if (next($matches[1]) === false && $element) {
if ($i + 1 == $matchCount && $element) {
$after = preg_quote($element);
}
if ($i == 0) {