Review 11.5 Merged

80079[BUGFIX] Enhance matching order for regex based redirects

Stefan Bürk CR +2 V +2 Normal +137 −14 updated 07/18/23, 13:27

Commit message

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.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 7

Review log 34

  1. Stefan Bürk uploaded patch set 1 07/18/23, 13:19

  2. core-ci voted on patch set 1 V +1 07/18/23, 13:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44252

  3. Stefan Bürk voted on patch set 1 V +2 CR +2 07/18/23, 13:27

  4. Stefan Bürk merged patch set 2 07/18/23, 13:27