From d2c275e20aaf95dc97c6651416e78091350338cc Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 16 Jun 2023 17:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A3=80=E6=B5=8B=E7=9A=84UR?= =?UTF-8?q?L=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/common.php b/application/common.php index ba19f6c4..4b4d812e 100755 --- a/application/common.php +++ b/application/common.php @@ -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;