summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-06-21 15:06:39 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-21 21:01:15 (GMT)
commit49f582a0401f3b9b9a80ff6fe0dd601520579b7d (patch)
treeb405f292296f1075ad331af5c674374c19146762
parent3f7f271004cd6b8f98bc4437408411c96a4766eb (diff)
downloadgit-49f582a0401f3b9b9a80ff6fe0dd601520579b7d.zip
git-49f582a0401f3b9b9a80ff6fe0dd601520579b7d.tar.gz
git-49f582a0401f3b9b9a80ff6fe0dd601520579b7d.tar.bz2
gitweb: Make use of $PATH_INFO for project parameter
Allow to have project name in the path part of URL, just after the name of script. For example instead of gitweb.cgi?p=git.git you can write gitweb.cgi/git.git or gitweb.cgi/git.git/ Not used in URLs inside gitweb; it means that the above alternate syntax must be generated by hand, at least for now. Side effect: project name parameter is now stripped of leading and trailing slash before validation. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgitweb/gitweb.cgi3
1 files changed, 2 insertions, 1 deletions
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index ef7fcbd..f2e5046 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -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.");