From 795e9c0ffc35172c3d45ca343f5ee3fa15a709ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=94=E5=A7=AC=E6=A1=91?= Date: Sun, 13 Sep 2020 10:16:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8IP=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/isForbidden.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/isForbidden.php b/app/Http/Middleware/isForbidden.php index a2ac11f6..ce4ee6d6 100644 --- a/app/Http/Middleware/isForbidden.php +++ b/app/Http/Middleware/isForbidden.php @@ -48,7 +48,7 @@ class isForbidden $ipLocation = IP::getIPInfo($ip); // 拒绝无IP请求 - if (empty($ipLocation) || empty($ipLocation['city'])) { + if ( ! $ipLocation || empty(array_filter($ipLocation))) { return Response::view( 'auth.error', ['message' => trans('error.ForbiddenAccess')],