Closed (fixed)
Project:
Redirect
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Dec 2021 at 12:30 UTC
Updated:
24 Dec 2021 at 08:24 UTC
Jump to comment: Most recent
Comments
Comment #3
dieterholvoet commentedComment #4
mondrakeComment #5
alexpottThis is one of the simplest fixes so probably okay. I wonder why we are not doing
$request_query = $request->query->all();- however both Symfony's query parameter bag and parse_str() can result in changing the initial query string.Hmmm - actually given that
\Symfony\Component\HttpFoundation\Request::getQueryString()calls\Symfony\Component\HttpFoundation\Request::normalizeQueryString()I think we should take the opportunity to change this to$request_query = $request->query->all();as that is guaranteed to return an array and then we don't have to parse the query params multiple times.Comment #6
berdirThere used to be some really nasty bugs around caching and redirect loops where a normalized query string was different but caching uses the other one. But, I think that was actually all in \Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber::onKernelRequestRedirect(), this here is just old code, hasn't changed since 2014. So yes, sounds fine to do that.
Comment #7
dieterholvoet commentedComment #8
kim.pepperSimple change. Looks good.
Comment #10
berdirThanks, merged.
Comment #11
berdirComment #12
berdirThere's one more 8.1 related test problem that people following this might be interested in fixing (see what I did there?): #3253718: Fix PHP 8.1 test fails