gitweb: Git config keys are case insensitive, make config search too
[gitweb.git] / gitweb / gitweb.perl
index 81dacf2b6a5d98550fa56adac9450560c550eee1..73492771d2ba4056b6f371328313d623a9550a0e 100755 (executable)
@@ -2510,6 +2510,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/);