From 91dacf4d15887dc616f8d157a5355620cd034982 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 22 Apr 2008 01:52:09 +0000 Subject: [PATCH] BUGFIX: Ticket #2408 - Fixed Geoip breaking when localhost is IPv6 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53178 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/Geoip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/Geoip.php b/security/Geoip.php index 67552c745..4bfdae3ff 100755 --- a/security/Geoip.php +++ b/security/Geoip.php @@ -285,7 +285,7 @@ class Geoip extends Object { static function ip2country($address, $codeOnly = false) { // Detect internal networks - this is us, so we're NZ - if(substr($address,0,7)=="192.168" || substr($address,0,4)=="127.") { + if(substr($address,0,7)=="192.168" || substr($address,0,4)=="127." || $address == "::1") { $code = "NZ"; } else { $cmd = "geoiplookup ".escapeshellarg($address);