summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f7f271)
raw | patch | inline | side by side (parent: 3f7f271)
author | Jakub Narebski <jnareb@gmail.com> | |
Wed, 21 Jun 2006 15:06:39 +0000 (17:06 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 21 Jun 2006 21:01:15 +0000 (14:01 -0700) |
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>
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>
gitweb/gitweb.cgi | patch | blob | history |
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index ef7fcbd84f1b80bfef982685a445cca1923692af..f2e50462d9b6160127b35f659ff8586369723b07 100755 (executable)
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
}
}
-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.");