You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is quite similar to #302 from what I can see.
Steps to reproduce:
Set your front-page to a page in WP settings
Make sure batcache is enabled
Request https://yoursite.com/?=123
Observe redirect_canonical should redirect to https://yoursite.com/
Try to request https://yoursite.com/
Observe an infinite redirect to https://yoursite.com/
When the query string is "malformed", specifically in this case, it's an empty key in ?=123 (no key, value of 123). In these situations $_GET is [], but $_SERVER['QUERY_STRING'] is =123. And, parse_url will be ["query"]=> string(4) "=123"
As you can maybe imagine, this causes issues when the assumption is the query / URL can be re-built from $_GET. One place that makes this assumption is Batcache. Effectively the cache will be stored as if there were no query params (see https://github.com/humanmade/batcache/blob/master/advanced-cache.php#L555, parse_str('=123', $result ) === []).
As redirect_canonical will do a 301 redirect, that redirect will get stored in Batcache against the homepage with no url params cache key. Therefore, the homepage will infinite redirect.
The text was updated successfully, but these errors were encountered:
This is quite similar to #302 from what I can see.
Steps to reproduce:
https://yoursite.com/?=123
https://yoursite.com/
https://yoursite.com/
https://yoursite.com/
When the query string is "malformed", specifically in this case, it's an empty
key
in?=123
(no key, value of 123). In these situations$_GET
is[]
, but$_SERVER['QUERY_STRING']
is=123
. And,parse_url
will be["query"]=> string(4) "=123"
As you can maybe imagine, this causes issues when the assumption is the query / URL can be re-built from $_GET. One place that makes this assumption is Batcache. Effectively the cache will be stored as if there were no query params (see https://github.com/humanmade/batcache/blob/master/advanced-cache.php#L555,
parse_str('=123', $result ) === []
).As
redirect_canonical
will do a 301 redirect, that redirect will get stored in Batcache against the homepage with no url params cache key. Therefore, the homepage will infinite redirect.The text was updated successfully, but these errors were encountered: