手动修复
5.0版本
在think\App类的module方法的获取控制器的代码后面加上
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
5.1版本
在think\route\dispatch\Url类的parseUrl方法,解析控制器后加上
if ($controller && !preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}附上原文链接 https://blog.thinkphp.cn/869075?spm=a2c4g.11174386.n2.6.30b21051ThgbHz
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号