Actions
Bug #101191
closedRedirects with regexp endabled and same urls, but one with additional query params matching the wrong one first
Start date:
2023-06-28
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
Example:
Need to match on two urls, each with different variants, that's why regexp is enabled, but one differs only by the query params from the other:
- /foo/(different_part)bar.html
- /foo/(different_part)bar.html?type=101
Created two regexp redirects records in this order (important):
- /\/foo\/(.*)bar.html$/ with target A
- /\/foo\/(.*)bar.html\?type=101/ with target B
With url 2 record 1 matches first, which is wrong. Record 2 should match first
If the redirect records are created the other way round it works correct, but this is not the solution.
IMO the foreach for the regexp redirects in RedirectService::matchRedirect needs to be run though twice, first with query and second one without, instead of a single run.
Actions