mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
废除url_deny_suffix配置参数 改由路由deny_ext参数定义
This commit is contained in:
@@ -461,11 +461,6 @@ class App
|
|||||||
*/
|
*/
|
||||||
public static function routeCheck($request, array $config)
|
public static function routeCheck($request, array $config)
|
||||||
{
|
{
|
||||||
// 检测URL禁用后缀
|
|
||||||
if ($config['url_deny_suffix'] && preg_match('/\.(' . $config['url_deny_suffix'] . ')$/i', $request->pathinfo())) {
|
|
||||||
throw new Exception('url suffix deny:' . $request->ext());
|
|
||||||
}
|
|
||||||
|
|
||||||
$path = $request->path();
|
$path = $request->path();
|
||||||
$depr = $config['pathinfo_depr'];
|
$depr = $config['pathinfo_depr'];
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|||||||
@@ -916,7 +916,8 @@ class Route
|
|||||||
// 请求类型检测
|
// 请求类型检测
|
||||||
if ((isset($option['method']) && false === stripos($option['method'], $request->method()))
|
if ((isset($option['method']) && false === stripos($option['method'], $request->method()))
|
||||||
|| (isset($option['ext']) && false === stripos($option['ext'], $request->ext())) // 伪静态后缀检测
|
|| (isset($option['ext']) && false === stripos($option['ext'], $request->ext())) // 伪静态后缀检测
|
||||||
|| (isset($option['domain']) && !in_array($option['domain'], [$_SERVER['HTTP_HOST'], self::$subDomain])) // 域名检测
|
|| (isset($option['deny_ext']) && false !== stripos($option['deny_ext'], $request->ext()))
|
||||||
|
|| (isset($option['domain']) && !in_array($option['domain'], [$_SERVER['HTTP_HOST'], self::$subDomain])) // 域名检测
|
||||||
|| (!empty($option['https']) && !$request->isSsl()) // https检测
|
|| (!empty($option['https']) && !$request->isSsl()) // https检测
|
||||||
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'], '', $url)) // 行为检测
|
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'], '', $url)) // 行为检测
|
||||||
|| (!empty($option['callback']) && is_callable($option['callback']) && false === call_user_func($option['callback'])) // 自定义检测
|
|| (!empty($option['callback']) && is_callable($option['callback']) && false === call_user_func($option['callback'])) // 自定义检测
|
||||||
|
|||||||
Reference in New Issue
Block a user