diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-04-26 08:14:26 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-04-26 08:14:26 +0000 |
commit | e5b216a983a654c942f6b373fa98f90e6b4e48f8 (patch) | |
tree | c1fa5784a5f0677bbba0a857fd756b71d7739c90 /lib | |
parent | 49612e89c66537cbf532f3c5a790869df81c9d06 (diff) | |
download | www-e5b216a983a654c942f6b373fa98f90e6b4e48f8.tar www-e5b216a983a654c942f6b373fa98f90e6b4e48f8.tar.gz www-e5b216a983a654c942f6b373fa98f90e6b4e48f8.tar.bz2 www-e5b216a983a654c942f6b373fa98f90e6b4e48f8.tar.xz www-e5b216a983a654c942f6b373fa98f90e6b4e48f8.zip |
Silence warning message in case of unknown IP address.
CCBUG 767
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Downloads.php | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |