From 7ef623807ff91258743db4d6555150fd38968eea Mon Sep 17 00:00:00 2001 From: Yorhel Date: Thu, 3 Feb 2011 17:12:47 +0100 Subject: Cleaner and more efficient method of checking for the &fil= param With the new TUWF, kv_validate() returns undef when the param isn't present and an empty string if it is, but left empty. This is a more efficient way to differentiate between empty and nonexistent than the previous YAWF-method of grepping all param names. --- lib/VNDB/Handler/VNBrowse.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/VNDB/Handler/VNBrowse.pm') diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm index be3f4d84..97dc4e69 100644 --- a/lib/VNDB/Handler/VNBrowse.pm +++ b/lib/VNDB/Handler/VNBrowse.pm @@ -21,11 +21,11 @@ sub list { { get => 'p', required => 0, default => 1, template => 'int' }, { get => 'q', required => 0, default => '' }, { get => 'sq', required => 0, default => '' }, - { get => 'fil',required => 0, default => '' }, + { get => 'fil',required => 0 }, ); return $self->resNotFound if $f->{_err}; $f->{q} ||= $f->{sq}; - $f->{fil} = $self->authPref('filter_vn') if !grep $_ eq 'fil', $self->reqParam(); + $f->{fil} //= $self->authPref('filter_vn'); my %compat = _fil_compat($self); return $self->resRedirect('/'.$1.$2.(!$3 ? '' : $1 eq 'd' ? '#'.$3 : '.'.$3), 'temp') -- cgit v1.2.3