diff options
author | Simon Green <sgreen@redhat.com> | 2014-05-22 01:17:46 +0200 |
---|---|---|
committer | Simon Green <sgreen@redhat.com> | 2014-05-22 01:17:46 +0200 |
commit | 9bd3f08dce23acc052819d97d1f082666c354b20 (patch) | |
tree | 6fee7c37bb9bff84a681593eff2e565e7bdb5f3e /Bugzilla/FlagType.pm | |
parent | abf6ec5cff89b9507aa978d5345559239886c014 (diff) | |
download | bugzilla-9bd3f08dce23acc052819d97d1f082666c354b20.tar.gz bugzilla-9bd3f08dce23acc052819d97d1f082666c354b20.tar.xz |
Bug 1008764: Add a web service to create and update Flag types
r=glob, a=justdave
Diffstat (limited to 'Bugzilla/FlagType.pm')
-rw-r--r-- | Bugzilla/FlagType.pm | 16 |
1 files changed, 13 insertions, 3 deletions
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 |