mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
改进
This commit is contained in:
@@ -1114,11 +1114,13 @@ class Route
|
|||||||
// 可选参数
|
// 可选参数
|
||||||
$val = substr($val, 1, -1);
|
$val = substr($val, 1, -1);
|
||||||
$optional = true;
|
$optional = true;
|
||||||
|
} else {
|
||||||
|
$optional = false;
|
||||||
}
|
}
|
||||||
if (0 === strpos($val, ':')) {
|
if (0 === strpos($val, ':')) {
|
||||||
// URL变量
|
// URL变量
|
||||||
$name = substr($val, 1);
|
$name = substr($val, 1);
|
||||||
if (!isset($optional) && !isset($m1[$key])) {
|
if (!$optional && !isset($m1[$key])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isset($m1[$key]) && isset($pattern[$name]) && !preg_match('/^' . $pattern[$name] . '$/', $m1[$key])) {
|
if (isset($m1[$key]) && isset($pattern[$name]) && !preg_match('/^' . $pattern[$name] . '$/', $m1[$key])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user