Merge pull request #183 from LAV45/master

Fix urlManager
This commit is contained in:
Qiang Xue
2013-05-08 09:02:28 -07:00

View File

@ -125,7 +125,7 @@ class UrlRule extends Object
if (isset($this->defaults[$name])) {
$length = strlen($match[0][0]);
$offset = $match[0][1];
if ($this->pattern[$offset - 1] === '/' && $this->pattern[$offset + $length] === '/') {
if ($offset > 1 && $this->pattern[$offset - 1] === '/' && $this->pattern[$offset + $length] === '/') {
$tr["/<$name>"] = "(/(?P<$name>$pattern))?";
} else {
$tr["<$name>"] = "(?P<$name>$pattern)?";