Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think a part of a previous PR should be rolled back.
There are quite a few sources of information and discussion about the plus sign, which is the main difference between the
urlencode
andrawurlencode
functions, along with their counterparts:However, currently, when trying to search "a b" results in the page heading showing "Search results for a+b". So rethought the whole encoding issue and split the problem in two:
At the beginning I thought about following the standard in both cases, but now I think it doesn't make much sense.
https://site.com/user/one+two
andhttps://site.com/user/one%20two
. The main issue here becomes forms (as shown in the links above). In short, forms will turn spaces into plus signs by default. So even if it is not following the standard, we need to process them in this way.Furthermore,
$_GET
superglobal gets their values already processed byurldecode
.%20
, rather than a+
Turning this into concrete changes, I'd say when creating URLs, we should keep the
rawurlencode
function calls. When interpreting the URLs, which happens in theindex.php
file, we should change the currentrawurldecode
functions tourldecode
.