Review main Merged

65137[BUGFIX] Ensure decoded parameters are a valid array

Oli Bartsch CR +2 V +2 Easy +1 −1 updated 08/10/20, 13:31

Commit message

Calling ShowImageController with old links containing serialized
parameters leads to PHP warnings as the json_decode doesn't
return an array in this case.

To prevent this warnings we now ensure that parameters is a valid
array in any case, prior to calling the foreach.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Oliver Klee +1
    • Stefan P +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Stefan P +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1213

  1. Oli Bartsch uploaded patch set 1 07/29/20, 07:40

  2. Oliver Hader voted on patch set 1 CR +1 07/29/20, 07:46

  3. Stefan P voted on patch set 1 V +1 CR +1 07/29/20, 07:48

  4. TYPO3com voted on patch set 1 V +1 07/29/20, 07:52 Completed build in 11m 23s on Wed, 29 Jul, 07:52 AM Test Summary: 72924 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4295

  5. Oliver Klee voted on patch set 1 CR +1 07/31/20, 17:39

  6. Oliver Klee wrote 07/31/20, 17:39

    Removed reviewer Oliver Klee with the following votes: * Code-Review+1 by Oliver Klee <typo3-coding@oliverklee.de>
  7. Andreas Kienast voted on patch set 1 CR +1 07/31/20, 19:20

  8. Oliver Klee voted on patch set 1 CR +1 08/02/20, 22:36

  9. Andreas Kienast commented on patch set 1 CR 0 08/05/20, 13:51

    ShowImageController.php:137

    json_decode _may_ return FALSE which will break the foreach as well - should we handle this case as well?
  10. Andreas Kienast commented on patch set 1 CR +1 08/05/20, 13:55

    ShowImageController.php:137 Reply Unresolved

    Never mind, false is only returned if the payload is constructed as such.
  11. Oliver Hader commented on patch set 1 V +1 08/10/20, 13:30

    I actually wanted to add some tests for this change - however for whatever reason the PHP warnings were "muted" somehow... → https://review.typo3.org/c/Packages/TYPO3.CMS/+/65240/1/typo3/sysext/frontend/Tests/Functional/Controller/ShowImageControllerTest.php as a separate change then
  12. Oliver Hader voted on patch set 1 V +2 CR +2 08/10/20, 13:31

  13. Oliver Hader merged patch set 2 08/10/20, 13:31