From f16ea977e2095a0e096686bdc6a6dc638f8a1ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E7=A4=BC=E9=AA=8F?= Date: Tue, 11 Jun 2019 18:59:46 +0800 Subject: [PATCH] Update ServerRequest.php --- src/ServerRequest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ServerRequest.php b/src/ServerRequest.php index e28736c..d9a6d71 100644 --- a/src/ServerRequest.php +++ b/src/ServerRequest.php @@ -433,8 +433,9 @@ public function getClientIP() $ip = $this->serverParams['REMOTE_ADDR']; } - if (false !== strpos($ip, ',')) { - $ip = reset(explode(',', $ip)); + if (false !== strpos($ip, ',')) + $ips=explode(',', $ip); + $ip = reset($ips); } return $ip;