内核更新,标签的更新

This commit is contained in:
2016-06-29 15:02:59 +08:00
parent c8e979b159
commit c98ca32ede
16 changed files with 354 additions and 342 deletions

View File

@@ -243,7 +243,7 @@ class Url
} elseif (empty($pattern) && array_intersect_assoc($param, $array) == $param) {
$match = true;
}
if (!empty($param) && array_intersect_assoc($param, $array) != $param) {
if ($match && !empty($param) && array_intersect_assoc($param, $array) != $param) {
$match = false;
}
if ($match) {
@@ -324,10 +324,6 @@ class Url
// 分析路由规则中的变量
private static function parseVar($rule)
{
// 检测是否设置了参数分隔符
if ($depr = Config::get('url_params_depr')) {
$rule = str_replace($depr, '/', $rule);
}
// 提取路由规则中的变量
$var = [];
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, '[:')) {
// 可选参数
$optional = true;