From: Jakub Narebski Date: Sat, 5 Aug 2006 11:16:03 +0000 (+0200) Subject: gitweb: PATH_INFO=/ means no project X-Git-Tag: v1.4.3-rc1~274^2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=668e34d7cc1ab7d6135f0004ee7bea2ffdca0de0;p=git.git gitweb: PATH_INFO=/ means no project Prepared for refactoring input validation. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 2e2629ca5..fdba15e2b 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"); }