]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: pass string after encoding in utf-8 to syntax highlighter
author张忠山 <redacted>
Thu, 4 Aug 2011 15:52:55 +0000 (23:52 +0800)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
Otherwise the highlight filter would work on a corrupt byte sequence.

Signed-off-by: 张忠山 <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 349c969376cc92d92f0a57edda32e7357a25c51ee5868c03fb3fec12af90bfe2..915f364fa6a453a95b468e4c72b05bc7d108fb291cff3f6bd0954d221d5b3084 100755 (executable)
@@ -6485,7 +6485,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, 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
This page took 0.329386 seconds and 4 git commands to generate.