Skip to content

Commit

Permalink
GH#63: escape query for autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Dec 19, 2016
1 parent 49e1b55 commit 4f53f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cpanfile
Expand Up @@ -9,6 +9,7 @@ requires "Net::SSLeay" => "1.49";
requires "Ref::Util" => "0";
requires "Safe::Isa" => "0";
requires "Search::Elasticsearch" => "== 2.03"; # pinned
requires "URI::Escape";
requires "perl" => "5.010";
requires "strict" => "0";
requires "warnings" => "0";
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Client.pm
Expand Up @@ -6,6 +6,7 @@ package MetaCPAN::Client;
use Moo;
use Carp;
use Ref::Util qw< is_arrayref is_hashref >;
use URI::Escape qw< uri_escape_utf8 >;

use MetaCPAN::Client::Request;
use MetaCPAN::Client::Author;
Expand Down Expand Up @@ -179,7 +180,7 @@ sub autocomplete {
my $res;

eval {
$res = $self->fetch("/search/autocomplete?q=$q");
$res = $self->fetch( '/search/autocomplete?q=' . uri_escape_utf8($q) );
1;

} or do {
Expand Down

0 comments on commit 4f53f86

Please sign in to comment.