diff options
author | Yorhel <git@yorhel.nl> | 2020-09-10 11:27:53 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-09-10 11:27:55 +0200 |
commit | 5eae77ca03f359c157460d81a2d36e91e036642f (patch) | |
tree | d6d29081de91d37578e662531e6074c8b104a79c /lib/VNDB/Func.pm | |
parent | d8885e3793c5906015ccd6af52c263989ec1a76d (diff) |
v2rw/filters: Add experimental validation + move compat to VNWeb
This is a minor start towards rewriting the filter logic in the new v2rw
code. Filters were never validated before (I didn't have a good
framework for it - now I do) and invalid filters would result in a 500.
The new validation code is not yet applied, but failed validations will
be logged so that I can see if it's working correctly.
I mean, what better way to test than to throw it in production?
I'll write new (and more flexible) SQL generation functions for these
filters later, so that v2rw code can get filtered results and I can make
a start on rewriting the pages that depend on the functionality. The
validation schema can also be used to validate the filters stored in the
DB, so I can use it to get rid of the complex handling of stored invalid
filters.
Diffstat (limited to 'lib/VNDB/Func.pm')
-rw-r--r-- | lib/VNDB/Func.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/Func.pm b/lib/VNDB/Func.pm index 2fcd5b54..508b2272 100644 --- a/lib/VNDB/Func.pm +++ b/lib/VNDB/Func.pm @@ -72,7 +72,7 @@ sub fil_serialize { my @v = ref $fil->{$_} ? @{$fil->{$_}} : ($fil->{$_}); s/$e/_$fil_escape{$1}/g for(@v); $_.'-'.join '~', @v - } grep defined($fil->{$_}), keys %$fil; + } grep defined($fil->{$_}), sort keys %$fil; } |