Review main Merged

55066[BUGFIX] Make sure that foreach loops are applied to arrays only

Wolfgang Klinger CR +2 V +2 Easy +11 −13 updated 12/14/17, 22:10

Commit message

Fix some foreach loops so as not to run into potentially empty elements.
Use the ?? operator to accomplish that.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Markus Klein +1
  • Verified V +2
    • Christian Kuhn +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1722

  1. Wolfgang Klinger uploaded patch set 1 12/14/17, 10:35

  2. Mathias Brodala commented on patch set 1 CR -1 12/14/17, 10:42

    AbstractNode.php:124

    I'd prefer the pattern "$array['key'] ?? []" instead.
  3. TYPO3com voted on patch set 1 V +1 12/14/17, 10:43 Completed build in 08m 05s on Thu, 14 Dec, 11:43 AM Test Summary: 29975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17710

  4. Wolfgang Klinger uploaded patch set 2 12/14/17, 10:50

  5. TYPO3com voted on patch set 2 V +1 12/14/17, 10:58 Completed build in 08m 16s on Thu, 14 Dec, 11:58 AM Test Summary: 29975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17711

  6. Mathias Brodala voted on patch set 2 CR +1 12/14/17, 11:03

  7. Christian Kuhn commented on patch set 2 12/14/17, 17:57

    ok to sanitize these calls. Note however that the result array should be initialized using $this->initializeResultArray(). This is why this issue pops up so late - all core classes use that und thus have the according array keys defined properly.
  8. Christian Kuhn uploaded patch set 3 12/14/17, 18:01

  9. Christian Kuhn voted on patch set 3 V +1 CR +1 12/14/17, 18:01

  10. Wolfgang Klinger commented on patch set 3 12/14/17, 18:04

  11. TYPO3com voted on patch set 3 V +1 12/14/17, 18:08 Completed build in 07m 15s on Thu, 14 Dec, 07:08 PM Test Summary: 29975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17740

  12. Markus Klein commented on patch set 3 CR -1 12/14/17, 19:36

    Unresolved

    This is not a commit msg, but a bug report. Moreover we can actually use the content of the commit msg to tell roughly where we change code.

    AbstractNode.php:112 Unresolved

    should be initialized
  13. Markus Klein commented on patch set 4 12/14/17, 19:40

    Published edit on patch set 3.
  14. Markus Klein commented on patch set 4 12/14/17, 19:41

    This change makes sense for 8.7 too of course. Maybe even 7.6?
  15. TYPO3com voted on patch set 4 V +1 12/14/17, 19:50 Completed build in 09m 22s on Thu, 14 Dec, 08:50 PM Test Summary: 29975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17747

  16. Wolfgang Klinger updated the commit message in patch set 5 12/14/17, 19:54

  17. TYPO3com voted on patch set 5 V +1 12/14/17, 20:04 Completed build in 09m 53s on Thu, 14 Dec, 09:04 PM Test Summary: 29975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17749

  18. Markus Klein voted on patch set 5 V +1 CR +1 12/14/17, 20:04

  19. Christian Kuhn commented on patch set 5 V +1 CR +1 12/14/17, 20:26

    fine with me to fix this. will also have a v8 backport as markus suggested. i'll update the docs with some hint on ->initializeResultArray() accordingly.
  20. Christian Kuhn voted on patch set 5 V +2 CR +2 12/14/17, 20:27

  21. Christian Kuhn merged patch set 6 12/14/17, 20:27