|
|
@ -174,7 +174,7 @@ class UrlRule extends Object implements UrlRuleInterface |
|
|
|
if (array_key_exists($name, $this->defaults)) { |
|
|
|
if (array_key_exists($name, $this->defaults)) { |
|
|
|
$length = strlen($match[0][0]); |
|
|
|
$length = strlen($match[0][0]); |
|
|
|
$offset = $match[0][1]; |
|
|
|
$offset = $match[0][1]; |
|
|
|
if ($offset > 1 && $this->pattern[$offset - 1] === '/' && $this->pattern[$offset + $length] === '/') { |
|
|
|
if ($offset > 1 && $this->pattern[$offset - 1] === '/' && (!isset($this->pattern[$offset + $length]) || $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)?"; |
|
|
|