Review main Merged

89619[BUGFIX] Fix URL parsing in UrlSoftReferenceParser

Sascha Egerer CR +2 V +2 Normal +78 −27 updated 06/05/25, 11:45

Commit message

The regular expression in UrlSoftReferenceParser
had four capture groups, but the code did expect five
groups, which ended up in unexpected results that
are now covered by tests.
Besides that, multiple URLs in a line could not be
detected properly due to the usage of preg_split().
With the usage of preg_match_all(), we can now get
multiple URLs in a line.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1215

  1. Sascha Egerer uploaded patch set 1 06/03/25, 22:02

  2. Sascha Egerer uploaded patch set 2 06/03/25, 22:04

  3. core-ci voted on patch set 1 V +1 06/03/25, 22:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79816

  4. core-ci voted on patch set 2 V +1 06/03/25, 22:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79817

  5. Sascha Egerer uploaded patch set 3 V +1 06/04/25, 07:27

  6. core-ci voted on patch set 3 V +1 06/04/25, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/79839

  7. Benni Mack commented on patch set 3 CR +1 06/04/25, 15:14

    thanks for making this much more readable
  8. Nikita Hovratov commented on patch set 3 06/04/25, 16:52

    I did something similar looong ago. Maybe you can take something from there: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75200
  9. Christian Kuhn commented on patch set 3 CR +1 V +1 06/04/25, 17:14

    not 100% sure about v12, though.
  10. Sascha Egerer commented on patch set 3 06/05/25, 09:12

    Reply

    You mean if it should be backported or if it is required? I've done this for a TYPO3 11 installation and it's running in production. So I would suggest doing a backport as it fixes a very annoying bug in the link validator if multiple domains are in one line in a text.
  11. Sascha Egerer commented on patch set 3 06/05/25, 09:14

    Reply

    That's disappointing... You're patch looks a way more complex - so hopefully we get at least this one in.
  12. Christian Kuhn commented on patch set 3 06/05/25, 09:28

    Reply

    ack. benni is fine with v12 as well and it applies without issues. i'm not 100% sure if v12 refindex would cope with the changed return array-key signatures, but it probably does. (the softrefindex return api is a nested array mess that needs to be fixed, i only touched some consumers in v13 but did not clean up softref itself).

    Reply

    i think we should go with your approach, sascha.
  13. Nikita Hovratov voted on patch set 3 CR +1 V +1 06/05/25, 10:55

  14. Benni Mack commented on patch set 3 CR +2 V +2 06/05/25, 11:45

    Thanks, Nikita, for referencing. I will look into the other issue, and see if the issue is now solved or we just add more tests. Btw: Your patch was the reason to create tests in this area in the first place. So it was definitively worth it! Thanks for all involved!
  15. Benni Mack merged patch set 4 06/05/25, 11:45