Review main Merged

71621[BUGFIX] Avoid warning when eID is given as array

Sebastian Michaelsen CR +2 V +2 Easy +14 −2 updated 10/13/21, 12:27

Commit message

Calling https://www.example.com/?eID[]= results in $eID being an array
which triggers an 'illegal offset' warning and an entry in the error log.

Reject these invalid queries with a 400 response.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
    • Sebastian Michaelsen +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
    • Sebastian Michaelsen +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1115

  1. Sebastian Michaelsen uploaded patch set 1 10/13/21, 11:19

  2. Benni Mack commented on patch set 2 10/13/21, 11:32

    Published edit on patch set 1.
  3. core-ci voted on patch set 1 V +1 10/13/21, 11:34 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18029

  4. Benjamin Franzke commented on patch set 2 CR -1 10/13/21, 11:39

    EidHandler.php:63

    This first "!" must be a typo.
  5. Sebastian Michaelsen uploaded patch set 3 10/13/21, 11:43

  6. Simon Schaufelberger commented on patch set 3 V +1 CR +1 10/13/21, 11:46

    EidHandler.php:63 Reply

    Done
  7. Benjamin Franzke commented on patch set 3 CR -1 10/13/21, 11:53

    Just had a second thought on this. I think this should be a 404 response. And then it's good (and easy) to add that case to typo3/sysext/frontend/Tests/Functional/SiteHandling/EidRequestTest.php

    EidHandler.php:63 Reply

    Done

    EidHandler.php:63

    Hm.. so we can't simply do !is_string($eID) because getParsedBody() might parse the body (not in our implementation of course) to be returned e.g. as integers? I'd just limit this to if (!is_string(…)) to be honest, as there is no way to trigger something else then string, array or null as result from $request->getParsedBody()['eID'] ?? $request->getQueryParams()['eID'] ?? null currently. And integer eIDs are not supported…
  8. core-ci voted on patch set 2 V +1 10/13/21, 11:54 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18032

  9. core-ci voted on patch set 3 V +1 10/13/21, 11:57 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18033

  10. Benjamin Franzke uploaded patch set 4 10/13/21, 12:02

  11. Benjamin Franzke commented on patch set 4 10/13/21, 12:02

    Reply

    Done

    EidHandler.php:63 Reply

    Done
  12. Sebastian Michaelsen voted on patch set 4 V +1 CR +1 10/13/21, 12:07

  13. core-ci voted on patch set 4 V +1 10/13/21, 12:18 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18034

  14. Christian Kuhn voted on patch set 4 V +2 CR +2 10/13/21, 12:26

  15. Christian Kuhn merged patch set 5 10/13/21, 12:27