Permalink
Browse files

Escape search URI correctly

  • Loading branch information...
1 parent 4f9e386 commit 79c6f214b24d4af2c988a379c336b00565823e90 @dgl committed Jul 25, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/WWW/CPANGrep.pm
View
4 lib/WWW/CPANGrep.pm
@@ -157,7 +157,7 @@ sub render_response {
$_ = $_->select('.file-number')
->replace_content($file->{truncated})
->select('.more-file')
- ->set_attribute(href => "/?q=$q+dist=$result->{distname}+file=$file->{file}");
+ ->set_attribute(href => "/?q=" . uri_escape_utf8($q) . "+dist=$result->{distname}+file=$file->{file}");
if($file->{truncated} == 1) {
$_ = $_->select('.file-plural')->replace("");
@@ -178,7 +178,7 @@ sub render_response {
$_ = $_->select('.dist-number')
->replace_content($result->{truncated})
->select('a.more-dist')
- ->set_attribute(href => "/?q=$q+dist=$result->{distname}");
+ ->set_attribute(href => "/?q=" . uri_escape_utf8($q) . "+dist=$result->{distname}");
if($result->{truncated} == 1) {
$_ = $_->select('.dist-plural')->replace("");

0 comments on commit 79c6f21

Please sign in to comment.