From: eldy <> Date: Sun, 1 May 2005 02:35:08 +0000 (+0000) Subject: Avoid bad cells if geo ip country does not exists. X-Git-Tag: AWSTATS_WEBMIN_1_6_BETA~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa54d09f4ff15f09cd933d4d0f7118a0e5576a58;p=thirdparty%2FAWStats.git Avoid bad cells if geo ip country does not exists. --- diff --git a/wwwroot/cgi-bin/plugins/geoip.pm b/wwwroot/cgi-bin/plugins/geoip.pm index a992dada..97551312 100644 --- a/wwwroot/cgi-bin/plugins/geoip.pm +++ b/wwwroot/cgi-bin/plugins/geoip.pm @@ -159,7 +159,7 @@ sub ShowInfoHost_geoip { if ($key && $ip==4) { my $res=lc($gi->country_code_by_addr($param)) if $gi; if ($Debug) { debug(" Plugin geoip: GetCountryByIp for $param: [$res]",5); } - if ($res) { print $DomainsHashIDLib{$res}; } + if ($res) { print $DomainsHashIDLib{$res}?$DomainsHashIDLib{$res}:' '; } else { print "$Message[0]"; } } if ($key && $ip==6) { @@ -168,7 +168,7 @@ sub ShowInfoHost_geoip { if (! $key) { my $res=lc($gi->country_code_by_name($param)) if $gi; if ($Debug) { debug(" Plugin geoip: GetCountryByHostname for $param: [$res]",5); } - if ($res) { print $DomainsHashIDLib{$res}; } + if ($res) { print $DomainsHashIDLib{$res}?$DomainsHashIDLib{$res}:' '; } else { print "$Message[0]"; } } print "";