Review main Merged

84872[BUGFIX] Silence regexp pattern errors in EXT:redirects

Stefan Bürk CR +2 V +2 Easy +4 −2 updated 06/25/24, 08:31

Commit message

This change adds a `@` silence operator to the usage of
`preg_match()` in the `RedirectService`. This prevents errors
in case of manually-entered malformed regexp patterns and follows
existing similar usages of the service.

Additionally, a todo comment is added to evaluate future early
pattern evaluation in record creation/editing so that
a proper response to invalid patterns can be emitted.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Benni Mack +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1216

  1. Stefan Bürk uploaded patch set 1 06/23/24, 21:20

  2. core-ci voted on patch set 1 V +1 06/23/24, 21:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60128

  3. Stefan Bürk updated the commit message in patch set 2 V +1 06/23/24, 21:36

  4. core-ci voted on patch set 2 V +1 06/23/24, 21:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60133

  5. Garvin Hicking updated the commit message in patch set 3 V +1 06/23/24, 22:01

  6. Garvin Hicking commented on patch set 3 CR +1 V +1 06/23/24, 22:04

    Minor question, there's another un-silenced preg_match in that file: ``` $matchResult = preg_match($matchedRedirect['source_path'], $uriToCheck, $matches); ``` I suppose that's less likely to fail? Don't know my way around ext:redirects too well.
  7. core-ci voted on patch set 3 V +1 06/23/24, 22:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60138

  8. Stefan Bürk voted on patch set 3 CR -1 06/24/24, 06:55

  9. Stefan Bürk uploaded patch set 4 CR +1 V +1 06/24/24, 07:36

  10. Stefan Bürk commented on patch set 4 06/24/24, 07:37

    Reply

    Should have been save, as this only processes redirect records already having a match successfully done. Added the silence operator - better be safe than sorry.
  11. core-ci voted on patch set 4 V +1 06/24/24, 07:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60159

  12. Oliver Klee voted on patch set 4 CR +1 06/24/24, 09:54

  13. Garvin Hicking voted on patch set 4 CR +1 V +1 06/24/24, 18:44

  14. Benni Mack voted on patch set 4 CR +1 V +1 06/25/24, 05:17

  15. Stefan Bürk voted on patch set 4 CR +2 V +2 06/25/24, 08:19

  16. Stefan Bürk merged patch set 5 06/25/24, 08:31