1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-15 08:46:26 +02:00

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>
This commit is contained in:
张忠山 2011-08-04 23:52:55 +08:00 committed by Junio C Hamano
parent 0d7c01c991
commit 927cd1fc94

View File

@ -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