mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进路由分组的URL匹配检查
This commit is contained in:
@@ -871,12 +871,13 @@ class Route
|
|||||||
|
|
||||||
if (is_array($rule)) {
|
if (is_array($rule)) {
|
||||||
// 分组路由
|
// 分组路由
|
||||||
if (($pos = strpos($key, ':')) || ($pos = strpos($key, '<'))) {
|
$pos = strpos(str_replace('<', ':', $key), ':');
|
||||||
|
if (false !== $pos) {
|
||||||
$str = substr($key, 0, $pos);
|
$str = substr($key, 0, $pos);
|
||||||
} else {
|
} else {
|
||||||
$str = $key;
|
$str = $key;
|
||||||
}
|
}
|
||||||
if (is_string($str) && 0 !== strpos($url, $str)) {
|
if (is_string($str) && $str && 0 !== strpos($url, $str)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user