mirror of https://gitee.com/karson/fastadmin.git
优化检测的URL默认值
parent
3549e95ea1
commit
d2c275e20a
|
|
@ -502,13 +502,17 @@ if (!function_exists('check_url_allowed')) {
|
|||
* @param string $url URL
|
||||
* @return bool
|
||||
*/
|
||||
function check_url_allowed($url = null)
|
||||
function check_url_allowed($url = '')
|
||||
{
|
||||
//允许的主机列表
|
||||
$allowedHostArr = [
|
||||
strtolower(request()->host())
|
||||
];
|
||||
|
||||
if (empty($url)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//如果是站内相对链接则允许
|
||||
if (preg_match("/^[\/a-z][a-z0-9][a-z0-9\.\/]+\$/i", $url) && substr($url, 0, 2) !== '//') {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue