Cope with non-ASCII $site_name
authorChris Morgan <me@chrismorgan.info>
committerChris Morgan <me@chrismorgan.info>
gitweb.cgi

index 91047b0e0ba37560264572f5f43ca4d0e8ea89ec..28a64eabb1b037574724638a19d98320c6e34a24 100755 (executable)
@@ -4086,11 +4086,11 @@ sub print_feed_meta {
        } else {
                printf('<link rel="alternate" title="%s projects list" '.
                       'href="%s" type="text/plain; charset=utf-8" />'."\n",
-                      esc_attr($site_name),
+                      esc_attr(to_utf8($site_name)),
                       esc_attr(href(project=>undef, action=>"project_index")));
                printf('<link rel="alternate" title="%s projects feeds" '.
                       'href="%s" type="text/x-opml" />'."\n",
-                      esc_attr($site_name),
+                      esc_attr(to_utf8($site_name)),
                       esc_attr(href(project=>undef, action=>"opml")));
        }
 }
@@ -8218,7 +8218,7 @@ sub git_feed {
        return if ($cgi->request_method() eq 'HEAD');
 
        # header variables
-       my $title = "$site_name - $project/$action";
+       my $title = to_utf8($site_name) . " - $project/$action";
        my $feed_type = 'log';
        if (defined $hash) {
                $title .= " - '$hash'";
@@ -8381,7 +8381,7 @@ sub git_opml {
                -charset => 'utf-8',
                -content_disposition => 'inline; filename="opml.xml"');
 
-       my $title = esc_html($site_name);
+       my $title = esc_html(to_utf8($site_name));
        my $filter = " within subdirectory ";
        if (defined $project_filter) {
                $filter .= esc_html($project_filter);