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
This commit is contained in:
Sean Harvey 2008-04-22 01:52:09 +00:00
parent 4a5443c5da
commit 91dacf4d15

View File

@ -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);