From: eldy <> Date: Sat, 26 Jul 2003 16:33:42 +0000 (+0000) Subject: geoipfree plugin return country codes inloawer cas (like geoip and country caught... X-Git-Tag: AWSTATS_5_7_BETA~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9bec99f3244c8e442a0ca075a75d9d932c238ec;p=thirdparty%2FAWStats.git geoipfree plugin return country codes inloawer cas (like geoip and country caught from domain). --- diff --git a/wwwroot/cgi-bin/plugins/geoipfree.pm b/wwwroot/cgi-bin/plugins/geoipfree.pm index d1a50d95..86404ec8 100644 --- a/wwwroot/cgi-bin/plugins/geoipfree.pm +++ b/wwwroot/cgi-bin/plugins/geoipfree.pm @@ -67,7 +67,9 @@ sub GetCountryCodeByName_geoipfree { # <----- my $res=$TmpDomainLookup{$_[0]}||''; if (! $res) { - ($res,undef)=$gi->LookUp($_[0]); if ($res !~ /\w\w/) { $res='ip'; } + ($res,undef)=$gi->LookUp($_[0]); + if ($res !~ /\w\w/) { $res='ip'; } + else { $res=lc($res); } $TmpDomainLookup{$_[0]}=$res; if ($Debug) { debug(" GetCountryCodeByName for $_[0]: $res",5); } } @@ -85,7 +87,9 @@ sub GetCountryCodeByAddr_geoipfree { # <----- my $res=$TmpDomainLookup{$_[0]}||''; if (! $res) { - ($res,undef)=$gi->LookUp($_[0]); if ($res !~ /\w\w/) { $res='ip'; } + ($res,undef)=$gi->LookUp($_[0]); + if ($res !~ /\w\w/) { $res='ip'; } + else { $res=lc($res); } $TmpDomainLookup{$_[0]}=$res; if ($Debug) { debug(" GetCountryCodeByAddr for $_[0]: $res",5); } }