提交 46a12fab 编写于 作者: D Devil

文件下载安全优化

上级 c3f2a410
......@@ -186,8 +186,12 @@ class Qrcode
return DataReturn('url地址有误', -1);
}
// 域名验证、仅支持下载当前域名下的文件
if(GetUrlHost(__MY_HOST__) != GetUrlHost($url))
// 验证下载地址域名
$domain_arr = [
GetUrlHost(config('shopxo.attachment_host')),
GetUrlHost(__MY_HOST__),
];
if(!in_array(GetUrlHost($url), $domain_arr))
{
return DataReturn('url地址非法', -1);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册