Review main Merged

75730[BUGFIX] Avoid FE error if url field on external pages is empty

Marc Willmann CR +2 V +2 Easy +1 −1 updated 09/16/22, 11:32

Commit message

Circumvent 'Unitialized string offset' error when trying to prefix the
url of a page from type 'external page' when field 'url' is not set.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Kevin Appelt +1
    • Christian Kuhn +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2326

Show 1 earlier messages
  1. Marc Willmann uploaded patch set 1 09/14/22, 09:09

  1. core-ci voted on patch set 1 V +1 09/14/22, 09:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31076

  2. David Nax voted on patch set 1 CR +1 09/14/22, 10:30

  3. Oliver Klee voted on patch set 1 CR +1 09/14/22, 10:32

  4. Oliver Klee commented on patch set 1 CR -1 09/14/22, 11:07

    ShortcutAndMountPointRedirect.php:124

    $redirectTo is a string, not an array. So using str_starts_with instead should do the trick.
  5. Marc Willmann commented on patch set 1 09/14/22, 12:27

    ShortcutAndMountPointRedirect.php:124 Reply

    str_starts_with is available in PHP8+. (https://www.php.net/manual/de/function.str-starts-with.php) As TYPO3 System requirements for 11.5 (which has this issue also) is PHP >= 7.4.1 <= 8.1.99 I assume the usage of str_starts_with opens up more problems than it solves.
  6. Kevin Appelt commented on patch set 1 CR -1 09/14/22, 12:42

    ShortcutAndMountPointRedirect.php:124 Reply

    Main is PHP 8.1+, but the backport for 11.5 needs adjustments of cause. So using str_starts_with for main seems to be the best solution.
  7. Stefan Bürk commented on patch set 1 09/14/22, 12:52

    ShortcutAndMountPointRedirect.php:124 Reply

    str_starts_with is pretty fine to backport. It is provided by a symfony polyfill package, which exists for v11. There are str_starts_with calls in v11 already.
  8. Marc Willmann uploaded patch set 2 09/14/22, 12:54

  9. Marc Willmann commented on patch set 2 09/14/22, 12:55

    Thanks for pointing this out. Lesson learned :-) Patch is adjusted.

    ShortcutAndMountPointRedirect.php:124 Reply

    Ack
  10. core-ci voted on patch set 2 V +1 09/14/22, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31083

  11. Stefan Bürk voted on patch set 2 V +1 CR +1 09/14/22, 13:21

  12. Oliver Klee voted on patch set 2 CR +1 09/14/22, 13:42

  13. Oliver Hader voted on patch set 2 CR +1 09/14/22, 13:55

  14. Stefan Bürk commented on patch set 2 CR -1 09/14/22, 13:58

    I think we should change the commit message - it's not correct anymore.
  15. Oliver Hader voted on patch set 2 CR -1 09/14/22, 14:00

  16. Oliver Hader commented on patch set 2 09/14/22, 14:01

    ShortcutAndMountPointRedirect.php:124

    Just realized: Shouldn't it be `!str_starts_with()`?
  17. Marc Willmann uploaded patch set 3 09/14/22, 14:09

  18. Oliver Klee voted on patch set 3 CR +1 09/14/22, 14:15

  19. core-ci voted on patch set 3 V +1 09/14/22, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31086

  20. Oliver Hader voted on patch set 3 CR +1 09/14/22, 18:46

  21. Kevin Appelt voted on patch set 3 CR +1 09/15/22, 04:54

  22. Oliver Klee commented on patch set 3 09/16/22, 11:11

    ShortcutAndMountPointRedirect.php:124 Reply

    Done
  23. Christian Kuhn voted on patch set 3 V +1 CR +1 09/16/22, 11:31

  24. Stefan Bürk voted on patch set 3 V +2 CR +2 09/16/22, 11:32

  25. Stefan Bürk merged patch set 4 09/16/22, 11:32