summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-04-17 17:44:22 +0200
committerYorhel <git@yorhel.nl>2018-04-17 17:44:25 +0200
commit6b3e403004b30d77b3011a6c65f0ad4f870cd622 (patch)
tree5149df8f024e7b3e2e2815fad79b1a7800ed5f44
parent1b0025f3140f5ef97a4222784cf2a38aa471d941 (diff)
TUWF::Request: Fix reqParams() and reqGets() with zero-but-defined input
Broken in previous commit.
-rw-r--r--lib/TUWF/Request.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/TUWF/Request.pm b/lib/TUWF/Request.pm
index 7ca545f..0ff4c08 100644
--- a/lib/TUWF/Request.pm
+++ b/lib/TUWF/Request.pm
@@ -70,7 +70,7 @@ sub _check_control {
sub _store {
return push @{$_[0]}, $_[1] if ref $_[0];
- $_[0] = $_[0] ? [$_[0], $_[1]] : $_[1];
+ $_[0] = defined $_[0] ? [$_[0], $_[1]] : $_[1];
}
@@ -186,7 +186,7 @@ sub _tablegets {
my $lst = $s->{_TUWF}{Req}{$k};
return keys %$lst if @_ == 2;
my $v = $lst->{$n};
- ref $v ? @$v : $v ? ($v) : ();
+ ref $v ? @$v : defined $v ? ($v) : ();
}
@@ -219,8 +219,8 @@ sub reqParams {
my $p = $nfo->{POST}{$n};
my $g = $nfo->{GET}{$n};
return (
- ref $p ? @$p : $p ? ($p) : (),
- ref $g ? @$g : $g ? ($g) : (),
+ ref $p ? @$p : defined $p ? ($p) : (),
+ ref $g ? @$g : defined $g ? ($g) : (),
);
}