Browse Source

Merge pull request #183 from LAV45/master

Fix urlManager
tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
b8b6180b81
  1. 2
      framework/web/UrlRule.php

2
framework/web/UrlRule.php

@ -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)?";

Loading…
Cancel
Save