diff options
-rw-r--r-- | lib/MGA/Mirrors/DB.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm index 78b6862..5ff0649 100644 --- a/lib/MGA/Mirrors/DB.pm +++ b/lib/MGA/Mirrors/DB.pm @@ -191,14 +191,14 @@ sub find_mirrors { country => 'countries.code', continent => 'countries.contienent_code', }->{$_}) { - push(@mw, sprintf('%s = ?', $field)); - push(@mvals, $filters->{$_}); + push(@mw, sprintf('%s = any(?)', $field)); + push(@mvals, ref $filters->{$_} ? $filters->{$_} : [ $filters->{$_} ]); } if (my $field = { protocol => 'protocol', }->{$_}) { - push(@uw, sprintf('%s = ?', $field)); - push(@uvals, $filters->{$_}); + push(@uw, sprintf('%s = any(?)', $field)); + push(@uvals, ref $filters->{$_} ? $filters->{$_} : [ $filters->{$_} ]); } } } @@ -228,8 +228,8 @@ sub _find_urls { protocol => 'urls.protocol', }->{$_} or next; - push(@w, sprintf('%s = ?', $field)); - push(@vals, $filters->{$_}); + push(@w, sprintf('%s = any(?)', $field)); + push(@vals, ref $filters->{$_} ? $filters->{$_} : [ $filters->{$_} ]); } $query .= join(' and ', @w); } |