metacpan / metacpan-grep-front-end

Grep Front end code
GNU General Public License v3.0
13 stars 13 forks source link

Page and recent searches links are not encoded properly #45

Closed Grinnz closed 6 years ago

Grinnz commented 6 years ago

Context

When doing a search like:

https://grep.metacpan.org/search?q=%3Dhead1%26&qd=&qft=

or

https://grep.metacpan.org/search?q=%3Dhead1&qd=&qft=

The pages and recent searches links contain the search unencoded, like:

https://grep.metacpan.org/search?q==head1&

or

https://grep.metacpan.org/search?p=2&qd=&qft=&qci=&q==head1&qls=

Which obviously will not work correctly.

Process

  1. Search for something using URL reserved characters
  2. Try to go to other pages of the search or go to it in recent searches

Expected result

Successful navigation

Current result

Incorrect urls

Possible Fix

Search query components should be URL encoded when attaching them to the URL. This should be automatically done by using any URL library to add query parameters.

atoomic commented 6 years ago

the previous attempt was using '| uri' filter inline which was not working as expected, switching to use URL plugin should solve this issue

Grinnz commented 6 years ago

The "recent searches" link still has the issue.

Grinnz commented 6 years ago

This looks fixed now. Thanks!