Review main Merged

78535[BUGFIX] Sanitize BackendUtility::titleAttribForPages()

Christian Kuhn CR +2 V +2 Easy +3 −0 updated 04/11/23, 10:00

Commit message

When the "Access" module is called without a selected
page, the root page icon rendering triggers a PHP 8.0
array access warning.

This was triggered by the refactoring with #100454, but
is a general issue of the method, which is why the patch
should go to 11.5 as well.

The patch sanitizes $row['uid']. Other parts of the
method access further array keys without fallback,
but those should be fine - at least for now - since
this is about 'pages', and if there is a uid, the
other fields are probably provided as well.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • Oliver Klee +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • Benni Mack +1

Issues 2

Files 1

Review log 1619

  1. Christian Kuhn uploaded patch set 1 04/07/23, 11:40

  2. core-ci voted on patch set 1 V +1 04/07/23, 11:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40331

  3. Oliver Klee voted on patch set 1 CR +1 04/07/23, 11:59

  4. Oliver Klee voted on patch set 1 CR 0 04/07/23, 11:59

  5. Oliver Klee commented on patch set 1 04/07/23, 12:00

    BackendUtility.php:1116

    Why is the fallback `true`? I'd have expected this to be `false` so this method does not try anything if there is no UID.
  6. Christian Kuhn commented on patch set 1 04/10/23, 13:43

    BackendUtility.php:1116 Reply

    return early if there is no uid ...
  7. Oliver Klee commented on patch set 1 CR -1 04/10/23, 14:03

    BackendUtility.php:1116 Reply

    Hm, then we have a bug here in the change: We'll also return early if there is a (non-zero) UID set (which does not make sense at all to me). Maybe we need a test for this, I think. And I'd like to suggest this code instead: ```php if (!isset($row['uid'])) { ```
  8. Christian Kuhn commented on patch set 1 04/10/23, 14:26

    BackendUtility.php:1116 Reply

    could you please provide the change that makes you more happy? from my point of view, the proposed solution is more than good enough.
  9. Christian Kuhn commented on patch set 1 CR -1 04/10/23, 14:42

    BackendUtility.php:1116 Reply

    scratch that, you're right.
  10. Christian Kuhn uploaded patch set 2 CR -1 V +1 04/10/23, 14:46

  11. core-ci voted on patch set 2 V +1 04/10/23, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40411

  12. Oliver Klee voted on patch set 2 CR +1 04/10/23, 14:56

  13. Benni Mack updated the commit message in patch set 3 CR +1 V +1 04/11/23, 09:49

  14. Benni Mack voted on patch set 3 V +1 CR +1 04/11/23, 09:49

  15. Oliver Klee voted on patch set 3 CR +1 04/11/23, 09:51

  16. Jochen Roth voted on patch set 3 V +1 CR +1 04/11/23, 09:53

  17. Christian Kuhn voted on patch set 3 V +2 CR +2 04/11/23, 09:56

  18. Christian Kuhn merged patch set 4 04/11/23, 09:56

  19. core-ci voted on patch set 3 V +1 04/11/23, 10:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40450