summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-09-10 11:38:54 +0200
committerYorhel <git@yorhel.nl>2020-09-10 11:38:56 +0200
commit387016461341757094bc10f41ecb5ce553a6dcc0 (patch)
tree83385128487f7948b00c6de96d786b57a8eb88e6
parent5eae77ca03f359c157460d81a2d36e91e036642f (diff)
v2rw/filters: Fix two validation errors found (instantly) in prod
Yay for getting some real-life testing without anyone noticing \o/
-rw-r--r--lib/VNWeb/Filters.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/VNWeb/Filters.pm b/lib/VNWeb/Filters.pm
index 8fae51a8..150c6e63 100644
--- a/lib/VNWeb/Filters.pm
+++ b/lib/VNWeb/Filters.pm
@@ -8,10 +8,10 @@ package VNWeb::Filters;
use VNWeb::Prelude;
my $VN = form_compile any => {
- date_before => { required => 0, rdate => 1 },
- date_after => { required => 0, rdate => 1 },
+ date_before => { required => 0, uint => 1, range => [0, 99999999] }, # don't use 'rdate' validation here, the search form allows invalid dates
+ date_after => { required => 0, uint => 1, range => [0, 99999999] }, # ^
released => { undefbool => 1 },
- length => { required => 0, enum => \%VN_LENGTH },
+ length => { undefarray => { enum => \%VN_LENGTH } },
hasani => { undefbool => 1 },
hasshot => { undefbool => 1 },
tag_inc => { undefarray => { id => 1 } },
@@ -36,8 +36,8 @@ my $RELEASE = form_compile any => {
freeware => { undefbool => 1 },
doujin => { undefbool => 1 },
uncensored => { undefbool => 1 },
- date_before => { required => 0, rdate => 1 },
- date_after => { required => 0, rdate => 1 },
+ date_before => { required => 0, range => [0, 99999999] }, # don't use 'rdate' validation here, the search form allows invalid dates
+ date_after => { required => 0, range => [0, 99999999] }, # ^
released => { undefbool => 1 },
minage => { undefarray => { enum => \%AGE_RATING } },
lang => { undefarray => { enum => \%LANGUAGE } },