When I first submit my search form via $_GET it returns results as expected but when using pagination and submitting it again for page X I see that it converts a portion of my URL and fails.
Here is the before and after URL portion that is changing:
// Before
min_score=1&max_score=10¬_scored=1
// After
min_score=1&max_score=10%AC_scored=1
It’s encoding 10& How can I prevent this from happening?
The reason is that
¬gets intepreted by the browser as¬. Strict mode or any DOCTYPE might help.And
¬simply gets substituted as¬then. Which in turn becomes%ACin request urls.Besides
urlencode()on the individual values you should additionally applyhtmlspecialchars()on the whole URL before you add it into the<a>tag.