From 0216c70d48b7a28ce5754c410abddee60e74e4b5 Mon Sep 17 00:00:00 2001 From: Darin McBride Date: Tue, 2 Dec 2014 15:13:52 -0700 Subject: [PATCH] Add a bit more input validation before passing on to DBIC --- lib/Lacuna/RPC/Inbox.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/RPC/Inbox.pm b/lib/Lacuna/RPC/Inbox.pm index 084eaf01..16f79232 100644 --- a/lib/Lacuna/RPC/Inbox.pm +++ b/lib/Lacuna/RPC/Inbox.pm @@ -119,9 +119,9 @@ sub trash_messages_where { { ++$count; my %where; - $where{tag} = $spec->{tags} if $spec->{tags} && ref $spec->{tags} eq 'ARRAY'; - $where{tag} ||= $spec->{tag} if $spec->{tag}; - $where{from_name} = [ $spec->{from} ] if $spec->{from}; + $where{tag} = $spec->{tags} if $spec->{tags} && ref $spec->{tags} eq 'ARRAY'; + $where{tag} ||= $spec->{tag} if $spec->{tag} && !ref $spec->{tag}; + $where{from_name} = [ $spec->{from} ] if $spec->{from} && !ref $spec->{from}; if ($spec->{subject}) { -- 2.51.2