Code

gitweb: PATH_INFO=/ means no project
authorJakub Narebski <jnareb@gmail.com>
Sat, 5 Aug 2006 11:16:03 +0000 (13:16 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 6 Aug 2006 08:59:45 +0000 (01:59 -0700)
Prepared for refactoring input validation.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index 2e2629ca53dcb67a78bfb62333b06181a435bd41..fdba15e2b23c4d80e6bb73d8a73a16c12f4a09a5 100755 (executable)
@@ -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");
        }