]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Output valid utf8 in git_blame_common('data')
[Gitweb] / gitweb.perl
index 0dc7e27b9ebecc4f93666955af4d70b708a01f0ccab37a901fd1166ab5c622c2..0dbca9d055cf5f67cba476952780d4cd05f0e1d0b96efd080751cd1f1462f179 100755 (executable)
@@ -1697,6 +1697,7 @@ sub chop_and_escape_str {
        my ($str) = @_;
 
        my $chopped = chop_str(@_);
+       $str = to_utf8($str);
        if ($chopped eq $str) {
                return esc_html($chopped);
        } else {
@@ -6244,7 +6245,9 @@ sub git_blame_common {
                        -type=>"text/plain", -charset => "utf-8",
                        -status=> "200 OK");
                local $| = 1; # output autoflush
-               print while <$fd>;
+               while (my $line = <$fd>) {
+                       print to_utf8($line);
+               }
                close $fd
                        or print "ERROR $!\n";
 
@@ -7863,11 +7866,12 @@ sub git_opml {
                -charset => 'utf-8',
                -content_disposition => 'inline; filename="opml.xml"');
 
+       my $title = esc_html($site_name);
        print <<XML;
 <?xml version="1.0" encoding="utf-8"?>
 <opml version="1.0">
 <head>
-  <title>$site_name OPML Export</title>
+  <title>$title OPML Export</title>
 </head>
 <body>
 <outline text="git RSS feeds">
This page took 0.15094 seconds and 4 git commands to generate.