diff --git a/lib/Pooru/API/V0/Controller/Tags.pm b/lib/Pooru/API/V0/Controller/Tags.pm index cb423c4..c3c7b0e 100644 --- a/lib/Pooru/API/V0/Controller/Tags.pm +++ b/lib/Pooru/API/V0/Controller/Tags.pm @@ -81,7 +81,7 @@ sub search ($self) status => 200 ) if $q eq ""; - $q =~ s/[\%_\\]/\\$&/g; + $q =~ s/[%\\_]/\\$&/g; $q .= '%'; my %attrs = ( $search_opts{TagCountView}->%*, @@ -95,7 +95,7 @@ sub search ($self) display => $_->display, count => $_->count, }, $self->schema->resultset("TagCountView") - ->search({name => {-like => $q}}, \%attrs); + ->search({name => \["LIKE ? ESCAPE '\\'", $q]}, \%attrs); return $self->render(json => {tags => [@tags]}); }