mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
4a5443c5da
commit
91dacf4d15
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user