mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
修正Driver驱动的一处sql组装解析的BUG
This commit is contained in:
@@ -368,7 +368,7 @@ class Route
|
||||
$pattern = $val['pattern'];
|
||||
|
||||
// 参数有效性检查
|
||||
if (!self::checkOption($option)) {
|
||||
if (!self::checkOption($option, $url)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class Route
|
||||
if (is_array($route)) {
|
||||
$option1 = $route[1];
|
||||
// 检查参数有效性
|
||||
if (!self::checkOption($option1)) {
|
||||
if (!self::checkOption($option1, $url)) {
|
||||
continue;
|
||||
}
|
||||
$pattern = array_merge($pattern, isset($route[2]) ? $route[2] : []);
|
||||
@@ -453,14 +453,14 @@ class Route
|
||||
}
|
||||
|
||||
// 路由参数有效性检查
|
||||
private static function checkOption($option)
|
||||
private static function checkOption($option, $url)
|
||||
{
|
||||
// 请求类型检测
|
||||
if ((isset($option['method']) && false === stripos($option['method'], REQUEST_METHOD))
|
||||
|| (isset($option['ext']) && false === stripos($option['ext'], __EXT__)) // 伪静态后缀检测
|
||||
|| (isset($option['domain']) && !in_array($option['domain'], [$_SERVER['HTTP_HOST'], self::$subDomain])) // 域名检测
|
||||
|| (!empty($option['https']) && !self::isSsl()) // https检测
|
||||
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'])) // 行为检测
|
||||
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'], $url)) // 行为检测
|
||||
|| (!empty($option['callback']) && is_callable($option['callback']) && false === call_user_func($option['callback'])) // 自定义检测
|
||||
) {
|
||||
return false;
|
||||
|
||||
@@ -260,7 +260,7 @@ abstract class Driver
|
||||
// 判断占位符
|
||||
$sql = is_numeric($key) ?
|
||||
substr_replace($sql, $val, strpos($sql, '?'), 1) :
|
||||
str_replace(':' . $key, $val, $sql);
|
||||
str_replace(':' . $key, $this->parseValue($val), $sql);
|
||||
}
|
||||
}
|
||||
return $sql;
|
||||
@@ -506,7 +506,6 @@ abstract class Driver
|
||||
} else {
|
||||
$array[] = $this->parseKey($field);
|
||||
}
|
||||
|
||||
}
|
||||
$fieldsStr = implode(',', $array);
|
||||
} elseif (is_string($fields) && !empty($fields)) {
|
||||
|
||||
Reference in New Issue
Block a user