php_yt 的个人博客 / 0 / 2 / 创建于 1年前 / 更新于 1年前
用了一个生成网页缓存的组件,就是把网页保存到本地。url 是 https://xxx.com/abc_464189,其中 abc_464189 是参数,没有判断参数的合法性,如果页面不存在还自定义了一个 404 页面,结果..
https://xxx.com/abc_464189
abc_464189
解决
if(!is_numeric($id)){ abort(404); } if (!preg_match('/^[a-zA-Z_]+$/', $prefix)) { abort(404); }Copy
if(!is_numeric($id)){ abort(404); } if (!preg_match('/^[a-zA-Z_]+$/', $prefix)) { abort(404); }
本作品采用《CC 协议》,转载必须注明作者和本文链接
咋不合并条件呢
if (!is_numeric($id) || !preg_match('/^[a-zA-Z_]+$/', $prefix)) { abort(404); }Copy
if (!is_numeric($id) || !preg_match('/^[a-zA-Z_]+$/', $prefix)) { abort(404); }
嗯,不重要。。
我要举报该,理由是:
推荐文章: