Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Quiet

90667[BUGFIX] Skip invalid parameters while creating editing form

Georg Ringer CR 0 V 0 Normal +51 −2 updated 10/22/26, 16:45

Commit message

The request argument "edit" is user input and may be of any
type. A non-array value, or a nested array using integer keys,
made EditDocumentController throw a PHP TypeError instead of
rendering the "Edit form could not be loaded" message.

This can be reproduced with links like:

`/typo3/record/edit?edit=fail`
`/typo3/record/edit?edit%5B0%5D%5B1%5D=edit`

Such links are created for example by be:link.editRecord
being called with an empty table name.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 7
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/90667/7 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/67/90667/7 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 2

Review log 3037

Show 1112 earlier messages
  1. Georg Ringer uploaded patch set 1 09/11/25, 19:36

  2. Georg Ringer commented on patch set 1 09/11/25, 19:36

    This change is ready for review.
  3. Markus Klein commented on patch set 1 09/11/25, 19:51

    EditDocumentController.php:418

    maybe check validity even here, before assigning it?

    EditDocumentController.php:577

    needed here as well?
  4. core-ci voted on patch set 1 V +1 09/11/25, 19:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84859

  5. Georg Ringer commented on patch set 1 09/12/25, 07:55

    @markus.klein@typo3.org yeah in theory this should be done far earlier but I fear missing some magic once done there. this whole code would need far more changes to convert those [table][id]=action magic into some DTOs - therefore I just wanted to fix this bug
  6. Markus Klein voted on patch set 1 CR +1 V +1 09/12/25, 08:02

  7. Nikita Hovratov commented on patch set 1 CR +1 V +1 09/12/25, 08:13

    Works, I get a flash message "Edit form could not be loaded" now.
  8. Garvin Hicking commented on patch set 1 09/12/25, 08:16

    EditDocumentController.php:958

    I don't feel good about this explicit phpstan rule. I think we should adjust the phpdoc comment above: ``` * @var array<string,array> ``` to include that its `string|int` because of userinput. Otherwise we should iterate the input GET var and do explicit (string) casting...?
  9. Nikita Hovratov commented on patch set 1 09/12/25, 08:16

    EditDocumentController.php:2100

    We could also adjust the type hint for editconf as array<string|int, array> I don't know if this might cause more stan errors at other places though.
  10. Garvin Hicking voted on patch set 1 CR -1 09/12/25, 08:16

  11. Oli Bartsch commented on patch set 1 09/12/25, 08:26

    EditDocumentController.php:418 Reply

    +1
  12. Georg Ringer uploaded patch set 2 CR +1 V +1 09/12/25, 08:44

  1. core-ci voted on patch set 2 V +1 09/12/25, 08:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84893

  2. Nikita Hovratov uploaded patch set 3 V +1 09/12/25, 08:59

  3. core-ci voted on patch set 3 V +1 09/12/25, 09:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84898

  4. Markus Klein commented on patch set 3 09/12/25, 09:16

    EditDocumentController.php:577 Reply

    Done
  5. Markus Klein voted on patch set 3 CR +1 09/12/25, 09:16

  6. Nikita Hovratov voted on patch set 3 CR +1 V +1 09/12/25, 09:25

  7. Nikita Hovratov commented on patch set 3 09/12/25, 09:25

    EditDocumentController.php:2100 Reply

    Done
  8. Garvin Hicking commented on patch set 3 CR -1 09/12/25, 10:52

    EditDocumentController.php:419

    'edit' can even be a string. Needs further restriction, on it.

    EditDocumentController.php:958 Reply

    Done
  9. Garvin Hicking commented on patch set 4 CR +1 V +1 09/12/25, 11:16

    Published edit on patch set 3.
  10. Garvin Hicking commented on patch set 4 09/12/25, 11:17

    EditDocumentController.php:419 Reply

    This had a few other cases, updated commit message and code. I don't feel too confident right now, happy for review.
  11. core-ci voted on patch set 4 V +1 09/12/25, 11:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84906

  12. Oli Bartsch commented on patch set 4 09/12/25, 11:42

    EditDocumentController.php:418 Reply

    Done

    EditDocumentController.php:419

    Why do we expect that to be an array while we check `$queryParams`? Can we get some code comment here? Using array_filter with a mix of ternary and null coalescing operators is really hard to understand..

    EditDocumentController.php:478

    Do we know the reason for not using `$this->editconf` here?

    EditDocumentController.php:2293

    Do we know the reason for not using `$this->editconf` here?
  13. Georg Ringer commented on patch set 4 09/16/25, 18:48

    @oli feel free to fix the other findings, but IMHO really not part of this patch
  14. Benni Mack updated the commit message in patch set 5 V +1 04/22/26, 06:31

  15. core-ci voted on patch set 5 V -1 04/22/26, 07:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100722

  16. Georg Ringer uploaded patch set 6 V -1 09/16/26, 20:59

  17. Georg Ringer commented on patch set 3 09/16/26, 21:05

    EditDocumentController.php:419 Reply

    Handled, a non-array edit parameter is caught before sanitizeEditConf() now.
  18. Georg Ringer commented on patch set 4 09/16/26, 21:05

    EditDocumentController.php:419 Reply

    Rewritten after the rebase, the array_filter is gone and there is a comment now.

    EditDocumentController.php:478 Reply

    prepareColumnsOnlyConfigurationFromRequest() still reads the raw query params. Using $this->editconf would additionally pull in parsedBody and the sanitizeEditConf() filtering (TCA existence, tables_modify).

    EditDocumentController.php:2293 Reply

    Gone with the rebase, the doc header title is built from FormElementData now.
  19. core-ci voted on patch set 6 V +1 09/16/26, 21:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108727

  20. Simon Schaufelberger commented on patch set 6 09/17/26, 09:11

    EditDocumentController.php:415

    should we not throw an exception if it's not a string instead of casting here?
  21. Benni Mack commented on patch set 6 10/22/26, 15:45

    what to do with this issue?
  22. Benni Mack uploaded patch set 7 V +1 10/22/26, 16:32

  23. Benni Mack marked it ready for review 10/22/26, 16:33

  24. Benni Mack commented on patch set 7 10/22/26, 16:33

    EditDocumentController.php:415 Reply

    Done

    EditDocumentController.php:419 Reply

    Done
  25. core-ci voted on patch set 7 V +1 10/22/26, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112151