[PATCH 8/9] gitweb: PATH_INFO=/ means no project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prepared for refactoring input validation.

Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 013bfe7..2e1a2ba 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");
        }
-- 
1.4.1.1


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]