]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: escape link body in format_ref_marker
[Gitweb] / gitweb.perl
index 40730e11d815b9c4291ab516ee0bc24e43eac2b6a3d285a2c8360593b37c2e52..a17455bb84567661ef2d63304f014d72ceb091a954861f20403d2f5ba93b2a72 100755 (executable)
@@ -2091,7 +2091,7 @@ sub format_ref_marker {
                                -href => href(
                                        action=>$dest_action,
                                        hash=>$dest
-                               )}, $name);
+                               )}, esc_html($name));
 
                        $markers .= " <span class=\"".esc_attr($class)."\" title=\"".esc_attr($ref)."\">" .
                                $link . "</span>";
@@ -3936,6 +3936,9 @@ sub run_highlighter {
 
        close $fd;
        open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
+                 quote_command($^X, '-CO', '-MEncode=decode,FB_DEFAULT', '-pse',
+                   '$_ = decode($fe, $_, FB_DEFAULT) if !utf8::decode($_);',
+                   '--', "-fe=$fallback_encoding")." | ".
                  quote_command($highlight_bin).
                  " --replace-tabs=8 --fragment --syntax $syntax |"
                or die_error(500, "Couldn't open file or run syntax highlighter");
This page took 0.21465 seconds and 4 git commands to generate.