From 26f3dc26da9910b73c63102beb504b8cb6cc0668 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Aug 2008 03:43:37 +0000 Subject: [PATCH] Fix error in Geoip when REMOTE_ADDR isn't set git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60606 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- integration/Geoip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/Geoip.php b/integration/Geoip.php index 67552c745..6207242ae 100755 --- a/integration/Geoip.php +++ b/integration/Geoip.php @@ -333,7 +333,7 @@ class Geoip extends Object { */ static function visitor_country() { if( ereg('^dev(\\.|$)', $_SERVER['HTTP_HOST']) && isset($_GET['country'])) return $_GET['country']; - else return Geoip::ip2country($_SERVER['REMOTE_ADDR'], true); + else if(isset($_SERVER['REMOTE_ADDR'])) return Geoip::ip2country($_SERVER['REMOTE_ADDR'], true); } /**