summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author张忠山 <zzs213@126.com>2011-08-04 15:52:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-04 19:13:38 (GMT)
commit927cd1fc940f7b588521b388aeb610ab3890399e (patch)
tree6dfb5fbd98cfc03347cf05355f3a62146f209627
parent0d7c01c991f2a783cc9cd89c050254ca1eb00213 (diff)
downloadgit-927cd1fc940f7b588521b388aeb610ab3890399e.zip
git-927cd1fc940f7b588521b388aeb610ab3890399e.tar.gz
git-927cd1fc940f7b588521b388aeb610ab3890399e.tar.bz2
gitweb: pass string after encoding in utf-8 to syntax highlighter
Otherwise the highlight filter would work on a corrupt byte sequence. Signed-off-by: 张忠山 <zzs213@126.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index dab89f2..48def38 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6465,7 +6465,7 @@ sub git_blob {
$nr++;
$line = untabify($line);
printf qq!<div class="pre"><a id="l%i" href="%s#l%i" class="linenr">%4i</a> %s</div>\n!,
- $nr, esc_attr(href(-replay => 1)), $nr, $nr, $syntax ? $line : esc_html($line, -nbsp=>1);
+ $nr, esc_attr(href(-replay => 1)), $nr, $nr, $syntax ? to_utf8($line) : esc_html($line, -nbsp=>1);
}
}
close $fd