]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: fix project list if PATH_INFO=="/".
authorMartin Waitz <redacted>
Wed, 16 Aug 2006 22:28:40 +0000 (00:28 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 3b0ace2e7e50b264bb20f8ea08e9c85f2024de71e45113a1912490f4d56f045d..83460391960d5790908fb016e0498959b3e0e22e8129732493e05c20c773165a 100755 (executable)
@@ -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");
        }
This page took 0.211165 seconds and 4 git commands to generate.