Thread (16 messages) flat view 16 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH] gitweb: fix project list if PATH_INFO=="/".

From: Martin Waitz <hidden>
Date: 2016-06-15 22:42:37
Subsystem: the rest · Maintainer: Linus Torvalds

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>
---
 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0a0b37f..3b6333c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -100,8 +100,9 @@ our $project = ($cgi->param('p') || $ENV
 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");
 	}
-- 
1.4.2.rc2.gf055
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help