From e5b216a983a654c942f6b373fa98f90e6b4e48f8 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Tue, 26 Apr 2011 08:14:26 +0000 Subject: Silence warning message in case of unknown IP address. CCBUG 767 --- lib/Downloads.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Downloads.php b/lib/Downloads.php index e64c9ee45..614ad09d1 100644 --- a/lib/Downloads.php +++ b/lib/Downloads.php @@ -169,14 +169,15 @@ class Downloads if (function_exists('geoip_country_code_by_name')) { - $loc = geoip_country_code_by_name($ip); + // may shout a "Host {IP} not found" + $loc = @geoip_country_code_by_name($ip); } else { require_once '../../lib/maxmind/geoip/geoip.inc.php'; $gi = geoip_open(realpath('../../lib/maxmind/geoip/GeoIP.dat'), GEOIP_STANDARD); - $loc = geoip_country_code_by_addr($gi, $ip); + $loc = @geoip_country_code_by_addr($gi, $ip); geoip_close($gi); } if (trim($loc) == '' || is_null($loc)) -- cgit v1.2.1