Commit b8b6180b by Qiang Xue

Merge pull request #183 from LAV45/master

Fix urlManager
parents c5bad9ea 3d4661ec
...@@ -125,7 +125,7 @@ class UrlRule extends Object ...@@ -125,7 +125,7 @@ class UrlRule extends Object
if (isset($this->defaults[$name])) { if (isset($this->defaults[$name])) {
$length = strlen($match[0][0]); $length = strlen($match[0][0]);
$offset = $match[0][1]; $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))?"; $tr["/<$name>"] = "(/(?P<$name>$pattern))?";
} else { } else {
$tr["<$name>"] = "(?P<$name>$pattern)?"; $tr["<$name>"] = "(?P<$name>$pattern)?";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment