]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: don't use pathinfo for global actions
[Gitweb] / gitweb.perl
index f49abf14e72872171ffbbbc4d26f53902c390f693b00df6b406fc3caf0e3cc1d..c579eff8a3782e8663b43c43c62af47f72e0350c6cb848c213cbf5db5c9dd719 100755 (executable)
@@ -835,7 +835,7 @@ sub href (%) {
        }
 
        my $use_pathinfo = gitweb_check_feature('pathinfo');
        }
 
        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
                # try to put as many parameters as possible in PATH_INFO:
                #   - project name
                #   - action
@@ -850,7 +850,7 @@ sub href (%) {
                $href =~ s,/$,,;
 
                # Then add the project name, if present
                $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
                delete $params{'project'};
 
                # since we destructively absorb parameters, we keep this
@@ -2152,8 +2152,9 @@ sub git_get_projects_list {
 
                                my $subdir = substr($File::Find::name, $pfxlen + 1);
                                # we check related file in $projectroot
 
                                my $subdir = substr($File::Find::name, $pfxlen + 1);
                                # we check related file in $projectroot
-                               if (check_export_ok("$projectroot/$filter/$subdir")) {
-                                       push @list, { path => ($filter ? "$filter/" : '') . $subdir };
+                               my $path = ($filter ? "$filter/" : '') . $subdir;
+                               if (check_export_ok("$projectroot/$path")) {
+                                       push @list, { path => $path };
                                        $File::Find::prune = 1;
                                }
                        },
                                        $File::Find::prune = 1;
                                }
                        },
@@ -6246,8 +6247,8 @@ XML
                }
 
                my $path = esc_html(chop_str($proj{'path'}, 25, 5));
                }
 
                my $path = esc_html(chop_str($proj{'path'}, 25, 5));
-               my $rss  = "$my_url?p=$proj{'path'};a=rss";
-               my $html = "$my_url?p=$proj{'path'};a=summary";
+               my $rss  = href('project' => $proj{'path'}, 'action' => 'rss', -full => 1);
+               my $html = href('project' => $proj{'path'}, 'action' => 'summary', -full => 1);
                print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
        }
        print <<XML;
                print "<outline type=\"rss\" text=\"$path\" title=\"$path\" xmlUrl=\"$rss\" htmlUrl=\"$html\"/>\n";
        }
        print <<XML;
This page took 0.16455 seconds and 4 git commands to generate.