From 668e34d7cc1ab7d6135f0004ee7bea2ffdca0de0 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 5 Aug 2006 13:16:03 +0200 Subject: [PATCH] gitweb: PATH_INFO=/ means no project Prepared for refactoring input validation. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 2e2629ca53..fdba15e2b2 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -86,8 +86,8 @@ if (defined $action) { } our $project = ($cgi->param('p') || $ENV{'PATH_INFO'}); -if (defined $project) { - $project =~ s|^/||; $project =~ s|/$||; +$project =~ s|^/||; $project =~ s|/$||; +if (defined $project && $project) { if (!validate_input($project)) { die_error(undef, "Invalid project parameter"); }