gitweb: don't use pathinfo for global actions
[gitweb.git] / gitweb / gitweb.perl
index 7999bb37d39431ff537f75ee03d01ee1ccceae77..b16400193dca05ee15f339c63ed1873ca1bc9337 100755 (executable)
@@ -830,7 +830,7 @@ (%)
        }
 
        my $use_pathinfo = gitweb_check_feature('pathinfo');
-       if ($use_pathinfo) {
+       if ($use_pathinfo and defined $params{'project'}) {
                # try to put as many parameters as possible in PATH_INFO:
                #   - project name
                #   - action
@@ -845,7 +845,7 @@ (%)
                $href =~ s,/$,,;
 
                # Then add the project name, if present
-               $href .= "/".esc_url($params{'project'}) if defined $params{'project'};
+               $href .= "/".esc_url($params{'project'});
                delete $params{'project'};
 
                # since we destructively absorb parameters, we keep this