From 9bd3f08dce23acc052819d97d1f082666c354b20 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Thu, 22 May 2014 09:17:46 +1000 Subject: Bug 1008764: Add a web service to create and update Flag types r=glob, a=justdave --- Bugzilla/FlagType.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Bugzilla/FlagType.pm') diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 773996b2e..34973684a 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -644,9 +644,19 @@ sub sqlify_criteria { my @criteria = ("1=1"); if ($criteria->{name}) { - my $name = $dbh->quote($criteria->{name}); - trick_taint($name); # Detaint data as we have quoted it. - push(@criteria, "flagtypes.name = $name"); + if (ref($criteria->{name}) eq 'ARRAY') { + my @names = map { $dbh->quote($_) } @{$criteria->{name}}; + # Detaint data as we have quoted it. + foreach my $name (@names) { + trick_taint($name); + } + push @criteria, $dbh->sql_in('flagtypes.name', \@names); + } + else { + my $name = $dbh->quote($criteria->{name}); + trick_taint($name); # Detaint data as we have quoted it. + push(@criteria, "flagtypes.name = $name"); + } } if ($criteria->{target_type}) { # The target type is stored in the database as a one-character string -- cgit v1.2.3-24-g4f1b