mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
修正Url类一处bug
This commit is contained in:
@@ -324,10 +324,6 @@ class Url
|
|||||||
// 分析路由规则中的变量
|
// 分析路由规则中的变量
|
||||||
private static function parseVar($rule)
|
private static function parseVar($rule)
|
||||||
{
|
{
|
||||||
// 检测是否设置了参数分隔符
|
|
||||||
if ($depr = Config::get('url_params_depr')) {
|
|
||||||
$rule = str_replace($depr, '/', $rule);
|
|
||||||
}
|
|
||||||
// 提取路由规则中的变量
|
// 提取路由规则中的变量
|
||||||
$var = [];
|
$var = [];
|
||||||
foreach (explode('/', $rule) as $val) {
|
foreach (explode('/', $rule) as $val) {
|
||||||
@@ -344,6 +340,9 @@ class Url
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('$' == substr($val, -1, 1)) {
|
||||||
|
$val = substr($val, 0, -1);
|
||||||
|
}
|
||||||
if (0 === strpos($val, '[:')) {
|
if (0 === strpos($val, '[:')) {
|
||||||
// 可选参数
|
// 可选参数
|
||||||
$optional = true;
|
$optional = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user