mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
tor.cgi: Fix missing country flag icons.
The CGI now is using the GeoIP::get_flag_icon function provided by the geoip-functions.pl, which takes care of the changed flag icons shipped by core update 90. Fixes #10919. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Tested-by: Jan Paul Tuecking <jan.paul.tuecking@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
a18b5b4f4d
commit
a9a28430b5
@@ -27,6 +27,7 @@ use warnings;
|
||||
use CGI::Carp 'fatalsToBrowser';
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/geoip-functions.pl";
|
||||
require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
|
||||
@@ -619,10 +620,14 @@ END
|
||||
END
|
||||
|
||||
if (exists($node->{'country_code'})) {
|
||||
if (!$node->{'country_code'} or $node->{'country_code'} eq '??') {
|
||||
print "<img src='/images/flags/blank.png' border='0' align='absmiddle'/>";
|
||||
# Get the flag icon of the country.
|
||||
my $flag_icon = &GeoIP::get_flag_icon($node->{'country_code'});
|
||||
|
||||
# Check if a flag for the given country is available.
|
||||
if ($flag_icon) {
|
||||
print "<a href='country.cgi#$node->{'country_code'}'><img src='$flag_icon' border='0' align='absmiddle' alt='$node->{'country_code'}'></a>";
|
||||
} else {
|
||||
print "<a href='country.cgi#$node->{'country_code'}'><img src='/images/flags/$node->{'country_code'}.png' border='0' align='absmiddle' alt='$node->{'country_code'}'></a>";
|
||||
print "<img src='/images/flags/blank.png' border='0' align='absmiddle'/>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user