]> Lady’s Gitweb - Gitweb/commitdiff
gitweb fix validating pg (page) parameter
authorMatthias Lederhofer <redacted>
Sun, 17 Sep 2006 11:52:45 +0000 (13:52 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
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 <redacted>
gitweb.perl

index 5bd175dd78a2572984d7ead4808ed2ff1b521c10998b7c27800a67fc45790455..8c0e4731921c5df05292aec634ca0efcc093e0f8c52009d5e5bd9117b4406905 100755 (executable)
@@ -256,7 +256,7 @@ if (defined $hash_parent_base) {
 
 our $page = $cgi->param('pg');
 if (defined $page) {
 
 our $page = $cgi->param('pg');
 if (defined $page) {
-       if ($page =~ m/[^0-9]$/) {
+       if ($page =~ m/[^0-9]/) {
                die_error(undef, "Invalid page parameter");
        }
 }
                die_error(undef, "Invalid page parameter");
        }
 }
This page took 0.207767 seconds and 4 git commands to generate.