From f51f051bc2c9dc4ea4f5185258cbdaa5f8e42242 Mon Sep 17 00:00:00 2001 From: the_undefined Date: Wed, 9 Apr 2008 19:07:02 +0000 Subject: [PATCH] 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 --- cake/libs/router.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 38af5334a..433a0ab09 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -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) {