diff options
author | Yorhel <git@yorhel.nl> | 2021-01-17 11:09:34 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-01-17 11:09:37 +0100 |
commit | c940802c172654efa6669cf2ff3161c8588f15b0 (patch) | |
tree | 3748308eeee04ced2956a002f45a52dfdf51c518 /lib | |
parent | a8fb32f31c1b843f6dc65f3ff48cd5ddb52b177c (diff) |
Chars::List: Fix trying to convert empty old filters
i.e. when the old filter consists only of a 'tagspoil' key.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNWeb/Chars/List.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VNWeb/Chars/List.pm b/lib/VNWeb/Chars/List.pm index 506f720f..d8ab1894 100644 --- a/lib/VNWeb/Chars/List.pm +++ b/lib/VNWeb/Chars/List.pm @@ -58,7 +58,8 @@ TUWF::get qr{/c(?:/(?<char>all|[a-z0]))?}, sub { # URL compatibility with old filters if(!$opt->{f}->{query} && $opt->{fil}) { my $q = eval { - tuwf->compile({ advsearch => 'c' })->validate(filter_char_adv filter_parse c => $opt->{fil})->data; + my $f = filter_char_adv filter_parse c => $opt->{fil}; + tuwf->compile({ advsearch => 'c' })->validate(@$f > 1 ? $f : undef)->data; }; if(!$q) { warn "Filter compatibility conversion failed\n$@"; |