git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Jürgen Kreileder" <jk@blackdown.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str()
Date: Tue, 29 Nov 2011 22:50:03 +0100	[thread overview]
Message-ID: <201111292250.04800.jnareb@gmail.com> (raw)
In-Reply-To: <CAKD0Uuy8y7Dc6gfvYVe-FJ=Reiu0M3wOY4r4VVPtEYmahZcdwA@mail.gmail.com>

Jürgen Kreileder wrote:

> a) To fix the comparison with the chopped string
> b) To give the title attribute correct encoding
> 
> Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
> ---
>  gitweb/gitweb.perl |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 4f0c3bd..4237ea6 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1695,11 +1695,11 @@ sub chop_and_escape_str {
>  	my ($str) = @_;

Why not simply

  	my $str = to_utf8(shift);
 
>  	my $chopped = chop_str(@_);
> -	if ($chopped eq $str) {
> +	if ($chopped eq to_utf8($str)) {
>  		return esc_html($chopped);
>  	} else {
>  		$str =~ s/[[:cntrl:]]/?/g;
> -		return $cgi->span({-title=>$str}, esc_html($chopped));
> +		return $cgi->span({-title => to_utf8($str)}, esc_html($chopped));
>  	}
>  }
> 
> -- 
> 1.7.5.4
> 

-- 
Jakub Narebski
Poland

  reply	other threads:[~2011-11-29 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 21:41 [PATCH] gitweb: Call to_utf8() on input string in chop_and_escape_str() Jürgen Kreileder
2011-11-29 21:50 ` Jakub Narebski [this message]
2011-11-29 22:14   ` Jürgen Kreileder

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=201111292250.04800.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jk@blackdown.de \
    /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;
as well as URLs for NNTP newsgroup(s).