Review main Merged

79967[BUGFIX] Enhance matching order for regex based redirects

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

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
    • Christian Kuhn +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 7

Review log 1117

  1. Stefan Bürk uploaded patch set 1 07/11/23, 11:41

  2. core-ci voted on patch set 1 V -1 07/11/23, 11:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44036

  3. Stefan Bürk uploaded patch set 2 V -1 07/11/23, 11:51

  4. core-ci voted on patch set 2 V -1 07/11/23, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44037

  5. Stefan Bürk uploaded patch set 3 V -1 07/11/23, 12:15

  6. core-ci voted on patch set 3 V +1 07/11/23, 12:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44038

  7. Stefan Bürk rebased onto patch set 4 V +1 07/12/23, 23:10

  8. core-ci voted on patch set 4 V +1 07/12/23, 23:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44097

  9. Oliver Klee voted on patch set 4 V +1 07/13/23, 07:30

  10. Nikita Hovratov updated the commit message in patch set 5 V +1 07/15/23, 20:35

  11. core-ci voted on patch set 5 V +1 07/15/23, 20:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44178

  12. Nikita Hovratov uploaded patch set 6 V +1 07/15/23, 20:51

  13. Nikita Hovratov voted on patch set 6 V +1 CR +1 07/15/23, 20:52

  14. core-ci voted on patch set 6 V +1 07/15/23, 20:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44179

  15. Christian Kuhn voted on patch set 6 V +1 CR +1 07/18/23, 12:10

  16. Stefan Bürk voted on patch set 6 V +2 CR +2 07/18/23, 12:29

  17. Stefan Bürk merged patch set 7 07/18/23, 12:29