tor.cgi: Fix missing country flag icons.
Message ID | 1444493258-24392-1-git-send-email-stefan.schantl@ipfire.org |
---|---|
State | Accepted |
Commit | a9a28430b5bce4f43fafd13f60b2e068eca1ea9a |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.tremer.info [172.28.1.200]) by septima.ipfire.org (Postfix) with ESMTP id 6DE4060456 for <patchwork@ipfire.org>; Sat, 10 Oct 2015 18:07:44 +0200 (CEST) Received: from hedwig.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 8E5AA1201; Sat, 10 Oct 2015 18:07:43 +0200 (CEST) Received: from tuxedo.stevee.com (unknown [217.111.161.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id D290AD81; Sat, 10 Oct 2015 18:07:40 +0200 (CEST) From: Stefan Schantl <stefan.schantl@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] tor.cgi: Fix missing country flag icons. Date: Sat, 10 Oct 2015 18:07:38 +0200 Message-Id: <1444493258-24392-1-git-send-email-stefan.schantl@ipfire.org> X-Mailer: git-send-email 2.4.3 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Stefan Schantl
11 Oct 2015, 3:07 a.m. UTC
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> --- html/cgi-bin/tor.cgi | 11 ++++++++--- lfs/tor | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-)
Comments
Merged. Thanks. On Sat, 2015-10-10 at 18:07 +0200, Stefan Schantl wrote: > 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> > --- > html/cgi-bin/tor.cgi | 11 ++++++++--- > lfs/tor | 2 +- > 2 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi > index 91f4b45..193e405 100644 > --- a/html/cgi-bin/tor.cgi > +++ b/html/cgi-bin/tor.cgi > @@ -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'/>"; > } > } > > diff --git a/lfs/tor b/lfs/tor > index c21e4b4..91eab09 100644 > --- a/lfs/tor > +++ b/lfs/tor > @@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE) > DIR_APP = $(DIR_SRC)/$(THISAPP) > TARGET = $(DIR_INFO)/$(THISAPP) > PROG = tor > -PAK_VER = 14 > +PAK_VER = 15 > > DEPS = "" >