Skip to content

Commit

Permalink
gitweb: Call to_utf8() on input string in chop_and_escape_str()
Browse files Browse the repository at this point in the history
a) To fix the comparison with the chopped string,
   otherwise we compare bytes with characters, as
   chop_str() must run to_utf8() for correct operation
b) To give the title attribute correct encoding;
   we need to mark strings as UTF-8 before outpur

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jürgen Kreileder authored and Junio C Hamano committed Dec 19, 2011
1 parent 406da78 commit 168c1e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,7 @@ sub chop_and_escape_str {
my ($str) = @_;

my $chopped = chop_str(@_);
$str = to_utf8($str);
if ($chopped eq $str) {
return esc_html($chopped);
} else {
Expand Down

0 comments on commit 168c1e0

Please sign in to comment.