]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: pass string after encoding in utf-8 to syntax highlighter
[Gitweb] / gitweb.perl
index e0d2365d3994f710c21d6af0ce61547daf62be69684cef2a7b1ba96c3d137535..915f364fa6a453a95b468e4c72b05bc7d108fb291cff3f6bd0954d221d5b3084 100755 (executable)
@@ -2527,6 +2527,13 @@ sub git_get_project_config {
 
        # key sanity check
        return unless ($key);
+       # only subsection, if exists, is case sensitive,
+       # and not lowercased by 'git config -z -l'
+       if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) {
+               $key = join(".", lc($hi), $mi, lc($lo));
+       } else {
+               $key = lc($key);
+       }
        $key =~ s/^gitweb\.//;
        return if ($key =~ m/\W/);
 
@@ -6478,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.300206 seconds and 4 git commands to generate.