改进路由分组的URL匹配检查

This commit is contained in:
thinkphp
2016-08-22 15:54:22 +08:00
parent c3015bf1c4
commit 714eb8f1b7

View File

@@ -871,12 +871,13 @@ class Route
if (is_array($rule)) {
// 分组路由
if (($pos = strpos($key, ':')) || ($pos = strpos($key, '<'))) {
$pos = strpos(str_replace('<', ':', $key), ':');
if (false !== $pos) {
$str = substr($key, 0, $pos);
} else {
$str = $key;
}
if (is_string($str) && 0 !== strpos($url, $str)) {
if (is_string($str) && $str && 0 !== strpos($url, $str)) {
continue;
}