mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
优化判断
This commit is contained in:
@@ -599,7 +599,7 @@ class Route
|
|||||||
$var = [];
|
$var = [];
|
||||||
foreach ($m2 as $key => $val) {
|
foreach ($m2 as $key => $val) {
|
||||||
// val中定义了多个变量 <id><name>
|
// val中定义了多个变量 <id><name>
|
||||||
if (preg_match_all('/<(\w+)>/', $val, $matches)) {
|
if (false !== strpos($val, '<') && preg_match_all('/<(\w+)>/', $val, $matches)) {
|
||||||
foreach ($matches[1] as $name) {
|
foreach ($matches[1] as $name) {
|
||||||
$val = str_replace('<' . $name . '>', '(' . $pattern[$name] . ')', $val);
|
$val = str_replace('<' . $name . '>', '(' . $pattern[$name] . ')', $val);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user