]> asedeno.scripts.mit.edu Git - git.git/commitdiff
gitweb fix validating pg (page) parameter
authorMatthias Lederhofer <matled@gmx.net>
Sun, 17 Sep 2006 11:52:45 +0000 (13:52 +0200)
committerJunio C Hamano <junkio@cox.net>
Sun, 17 Sep 2006 22:10:23 +0000 (15:10 -0700)
Currently it is possible to give any string ending with a number as
page.  -1 for example is quite bad (error log shows probably 100
warnings).

Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index 0fb86385c94a72c08fce4bc0b2c54c1461ad2bc6..c77270c7cd7ef478f708dbbc6165ac420891ca5a 100755 (executable)
@@ -256,7 +256,7 @@ if (defined $hash_parent_base) {
 
 our $page = $cgi->param('pg');
 if (defined $page) {
-       if ($page =~ m/[^0-9]$/) {
+       if ($page =~ m/[^0-9]/) {
                die_error(undef, "Invalid page parameter");
        }
 }