Browse Source

gitweb: fix project list if PATH_INFO=="/".

The project list now uses several common header / footer generation functions.
These functions only check for "defined $project", but when PATH_INFO just
contains a "/" (which is often generated by web servers), then this test
fails.

Now explicitly undef $project if there is none so that the tests in other
gitweb parts work again.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Martin Waitz 18 years ago committed by Junio C Hamano
parent
commit
13d0216504
  1. 3
      gitweb/gitweb.perl

3
gitweb/gitweb.perl

@ -95,8 +95,9 @@ our $project = ($cgi->param('p') || $ENV{'PATH_INFO'}); @@ -95,8 +95,9 @@ our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
if (defined $project) {
$project =~ s|^/||;
$project =~ s|/$||;
$project = undef unless $project;
}
if (defined $project && $project) {
if (defined $project) {
if (!validate_input($project)) {
die_error(undef, "Invalid project parameter");
}

Loading…
Cancel
Save