From: Stefan Schantl Date: Tue, 22 Sep 2020 18:25:03 +0000 (+0200) Subject: tor.cgi: Use own location functions. X-Git-Tag: v2.25-core151~8^2~55 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=8b4525732624aba0fccb506088167d5c1441ab2e tor.cgi: Use own location functions. Signed-off-by: Stefan Schantl Signed-off-by: Michael Tremer --- diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index c9416be011..28dec6cf0d 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -20,7 +20,6 @@ ############################################################################### use strict; -use Locale::Codes::Country; # enable only the following on debugging purpose #use warnings; @@ -31,6 +30,9 @@ require "${General::swroot}/location-functions.pl"; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; +# Init libloc database connection. +my $db_handle = &Location::Functions::init(); + #workaround to suppress a warning when a variable is used only once my @dummy = ( ${Header::colouryellow} ); undef (@dummy); @@ -321,10 +323,14 @@ END END - my @country_names = Locale::Codes::Country::all_country_names(); - foreach my $country_name (sort @country_names) { - my $country_code = Locale::Codes::Country::country2code($country_name); + my @country_codes = &Location::database_countries(); + foreach my $country_code (@country_codes) { + # Convert country code into upper case format. $country_code = uc($country_code); + + # Get country name. + my $country_name = &Location::Functions::get_country_name($country_code); + print "