]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.cgi
gitweb: Make use of $PATH_INFO for project parameter
[Gitweb] / gitweb.cgi
index dbafb5d184aba3c6f5384131f15ba048c2aba79510f6ebb9d7290d028b82605a..fec89e73d80b3129e70f2fb4da9ca2fac95a6cf1a487dff8f7f37a52c8b0a0a8 100755 (executable)
@@ -22,13 +22,13 @@ my $my_url = $cgi->url();
 my $my_uri = $cgi->url(-absolute => 1);
 my $rss_link = "";
 
+# location of the git-core binaries
+my $gitbin = "/usr/bin";
+
 # absolute fs-path which will be prepended to the project path
 #my $projectroot = "/pub/scm";
 my $projectroot = "/home/kay/public_html/pub/scm";
 
-# location of the git-core binaries
-my $gitbin = "/usr/bin";
-
 # version of the git-core binaries
 my $git_version = qx($gitbin/git --version);
 if ($git_version =~ m/git version (.*)$/) {
@@ -86,8 +86,9 @@ if (defined $order) {
        }
 }
 
-my $project = $cgi->param('p');
+my $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
 if (defined $project) {
+       $project =~ s|^/||; $project =~ s|/$||;
        $project = validate_input($project);
        if (!defined($project)) {
                die_error(undef, "Invalid project parameter.");
This page took 0.166486 seconds and 4 git commands to generate.