From 137bac6f0148871a3573b34e64ac10154eefd420 Mon Sep 17 00:00:00 2001 From: adolfintel Date: Thu, 27 Dec 2018 17:03:26 +0100 Subject: [PATCH] Merged #188 from master --- Test backends/getIP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Test backends/getIP.php b/Test backends/getIP.php index d4ac0bb..01fa5ab 100644 --- a/Test backends/getIP.php +++ b/Test backends/getIP.php @@ -22,11 +22,11 @@ if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = preg_replace("/^::ffff:/", "", $ip); -if (strpos($ip, '::1') !== false) { +if ($ip == "::1") { // ::1/128 is the only localhost ipv6 address. there are no others, no need to strpos this echo json_encode(['processedString' => $ip . " - localhost ipv6 access", 'rawIspInfo' => ""]); die(); } -if (strpos($ip, '127.0.0') !== false) { +if (strpos($ip, '127.') === 0) { //anything within the 127/8 range is localhost ipv4, the ip must start with 127.0 echo json_encode(['processedString' => $ip . " - localhost ipv4 access", 'rawIspInfo' => ""]); die(); }