相信很多人平时都没什么注意。平时做好漏洞修复以及安全防护是非常有必要的
tp5.0
所在路径/thinkphp/library/think/App.php
搜索获取控制器名 加入以下代码即可
if (!preg_match('/^[A-Za-z][\w\.]*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
tp5.1
所在路径
/thinkphp/library/think/route/dispatch/Module.php
搜索获取控制器名 加入以下代码即可
if (!preg_match('/^[A-Za-z][\w\.]*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}