]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.cgi
add broken latin encoding to test file
[Gitweb] / gitweb.cgi
index c3b242fda36ffafa5ce759f855c9eb58826d98b023c700c19ab1b4511f50cefe..67345d6e13abf01f7e4e67c46d65a3799de56991ddc21daef3fa00f03c757b5f 100755 (executable)
@@ -14,9 +14,10 @@ use CGI::Util qw(unescape);
 use CGI::Carp qw(fatalsToBrowser);
 use Encode;
 use Fcntl ':mode';
+binmode STDOUT, ':utf8';
 
 my $cgi = new CGI;
-my $version =          "250";
+my $version =          "253";
 my $my_url =           $cgi->url();
 my $my_uri =           $cgi->url(-absolute => 1);
 my $rss_link =         "";
@@ -217,8 +218,8 @@ sub esc_url {
 
 sub esc_html {
        my $str = shift;
-       $str = escapeHTML($str);
        $str = decode("utf8", $str, Encode::FB_DEFAULT);
+       $str = escapeHTML($str);
        return $str;
 }
 
@@ -1308,7 +1309,8 @@ sub git_blob {
                      " | " . $cgi->a({-href => esc_url("$my_uri?p=$project;a=commitdiff;h=$hash_base")}, "commitdiff") .
                      " | " . $cgi->a({-href => esc_url("$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base")}, "tree") . "<br/>\n";
                if (defined $file_name) {
-                       print $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob_plain;h=$hash;f=$file_name")}, "plain") . "<br/>\n";
+                       print $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob_plain;h=$hash;f=$file_name")}, "plain") .
+                       " | " . $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob;hb=HEAD;f=$file_name")}, "head") . "<br/>\n";
                } else {
                        print $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob_plain;h=$hash")}, "plain") . "<br/>\n";
                }
@@ -1430,7 +1432,7 @@ sub git_tree {
                              $cgi->a({-href => esc_url("$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key)}, $t_name) .
                              "</td>\n" .
                              "<td class=\"link\">" .
-                             $cgi->a({-href => esc("$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key)}, "tree") .
+                             $cgi->a({-href => esc_url("$my_uri?p=$project;a=tree;h=$t_hash" . $base_key . $file_key)}, "tree") .
                              "</td>\n";
                }
                print "</tr>\n";
@@ -1809,7 +1811,7 @@ sub git_commit {
                              $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob;h=$from_id;hb=$hash;f=$from_file"), -class => "list"}, esc_html($from_file)) .
                              " with " . (int $similarity) . "% similarity$mode_chng]</span></td>\n" .
                              "<td class=\"link\">" .
-                             $cgi->a({-href => esc_uresc_url("$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob");
+                             $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob");
                        if ($to_id ne $from_id) {
                                print " | " . $cgi->a({-href => esc_url("$my_uri?p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$to_file")}, "diff");
                        }
This page took 0.252441 seconds and 4 git commands to generate.