|
@@ -477,6 +477,7 @@ if (!function_exists('check_ip_allowed')) {
|
|
|
$forbiddenipArr = config('site.forbiddenip');
|
|
|
$forbiddenipArr = !$forbiddenipArr ? [] : $forbiddenipArr;
|
|
|
$forbiddenipArr = is_array($forbiddenipArr) ? $forbiddenipArr : array_filter(explode("\n", str_replace("\r\n", "\n", $forbiddenipArr)));
|
|
|
+ $forbiddenipArr[]='127.0.0.1';
|
|
|
if (/*$forbiddenipArr && */ /*!config('app_debug') && */!\Symfony\Component\HttpFoundation\IpUtils::checkIp($ip, $forbiddenipArr)) {
|
|
|
$response = Response::create('请求未加入白名单('.$ip.')无权访问', 'html', 403);
|
|
|
throw new HttpResponseException($response);
|