Default URL redirect adds spurious '?'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Libravatar (obsolete) |
Triaged
|
Low
|
Unassigned |
Bug Description
If one uses a default URL such as <http://
http://
Then, assuming the hash does not exist, one gets redirected to:
http://
Which is not the specified page, due to a spurious escaped '?' at the end of the URL.
I strongly suspect this is caused by the '?' at the end of '${url_decode:%1}?' in following RewriteRule in config/
RewriteCond %{QUERY_STRING} ^(?:.*&
RewriteCond %1 !^(retro|
RewriteRule ^/avatar/ ${url_decode:%1}? [last,redirect=
Presumably the goal of that trailing '?' is to avoid mod_rewrite's query-string-
Possibly fixable (regrettably, untested) with something like the following RewriteRule preceding the aforementioned rule:
# Detect query parameters in the default URL and redirect specially
RewriteCond %{QUERY_STRING} ^(?:.*&
RewriteCond %1 !^(retro|
RewriteRule ^/avatar/ ${url_decode:%1} [last,redirect=
(That is, specially note an escaped question mark and avoid appending an additional one.)
But perhaps it's far enough outside of the expected use case as to not even be worth fixing. I'll leave that to you. :)
That seems like something that should be working.
Setting a low priority mainly because it's pretty hard to get these regexps right and it requires a lot of testing.