From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] tor.cgi: Fix missing country flag icons.
Date: Thu, 15 Oct 2015 15:43:20 +0100 [thread overview]
Message-ID: <1444920200.18375.36.camel@ipfire.org> (raw)
In-Reply-To: <1444493258-24392-1-git-send-email-stefan.schantl@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]
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(a)ipfire.org>
> Tested-by: Jan Paul Tuecking <jan.paul.tuecking(a)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 = ""
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-10-15 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-10 16:07 Stefan Schantl
2015-10-15 14:43 ` Michael Tremer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444920200.18375.36.camel@ipfire.org \
--to=michael.tremer@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox