From eb103a63a5c44e4268922897f0ff144bac9dfb2b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 22 Oct 2016 13:21:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BBip=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index bc43eb2f..c6f1198a 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1241,8 +1241,7 @@ class Request if (false !== $pos) { unset($arr[$pos]); } - - $ip = trim($arr[0]); + $ip = trim(current($arr)); } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['REMOTE_ADDR'])) {