summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Prelude.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-11 17:18:11 +0200
committerYorhel <git@yorhel.nl>2020-04-11 17:18:11 +0200
commit3ada3f1bcc759a862b1851e3a7c8b01f4f8d290c (patch)
tree9b1917d765b8ad1b2c53e94ff06d5624e707e5b6 /lib/VNWeb/Prelude.pm
parentdd47ffa14bbf91827ee1c05f33538f153e037f3e (diff)
Limit identifier input validation to the range supported by the "vndbid" type
Diffstat (limited to 'lib/VNWeb/Prelude.pm')
-rw-r--r--lib/VNWeb/Prelude.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VNWeb/Prelude.pm b/lib/VNWeb/Prelude.pm
index e504d8e7..cd95c046 100644
--- a/lib/VNWeb/Prelude.pm
+++ b/lib/VNWeb/Prelude.pm
@@ -75,7 +75,7 @@ sub import {
# Regular expressions for use in path registration
-my $num = qr{[1-9][0-9]{0,8}};
+my $num = qr{[1-9][0-9]{0,6}}; # Allow up to 10 mil, SQL vndbid type can't handle more than 2^26-1 (~ 67 mil).
my $id = qr{(?<id>$num)};
my $rev = qr{(?:\.(?<rev>$num))};
our %RE = (
@@ -90,6 +90,7 @@ our %RE = (
did => qr{d$id},
tid => qr{t$id},
gid => qr{g$id},
+ imgid=> qr{(?<id>(?:ch|cv|sf)$num)},
vrev => qr{v$id$rev?},
rrev => qr{r$id$rev?},
prev => qr{p$id$rev?},