Skip to content
Snippets Groups Projects
Commit 1f1082b9 authored by Stefan Bürk's avatar Stefan Bürk Committed by Stefan B�rk
Browse files

[BUGFIX] Enhance matching order for regex based redirects

RegEx redirects have been processed in the order how they
have been inserted into the database ignoring the flag
`respect_query_parameters` completely. Due to this fact,
a non-query argument based regex redirect would match
before a concrete query-argument aware regexp redirect
have been matched - additionally favored by the changes
introduced with #96480 to provide a fallback.

To combine all use-cases and additionally fix the detected
issues, this change now splits the cached regex redirects
into two flavors:

* `regexp_respect_query_parameters`
* `regexp_flat`

That follows the pre-selection for the non-regex redirects.
Redirects respecting query paramaters have higher precedence
above the non-respecting once. Therefore, the matching flow
in the `RedirectService` has been aligned correspondingly to
respect this separated workflow.

The #96480 is now only applied for regex redirects which do
not respect query-arguments at all. It should be considered
if we should remove that safety fallback and enforce correct
regex redirects in a dedicated future change.

Furthermore, a deterministic sorting criteria chain has been
added to the `RedirectCacheService` to ensure a deterministic
loading and caching order of redirects.

The changes play together, which is the reason why they are
included in one change and to avoid a inbetween incorrect
test chain.

Regression tests have been added to cover the cases.

Resolves: #101191
Related: #96480
Releases: main, 12.4, 11.5
Change-Id: I9638835c33809e92ba883efb65d86bb1e9f5031b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80079


Tested-by: default avatarStefan B�rk <stefan@buerk.tech>
Reviewed-by: default avatarStefan B�rk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent 2bc1c01d
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment