Review main Merged

36480[BUGFIX] Type checking at PageRepository::getFileReferences() call

Alina Fleser CR +2 V +2 Easy +8 −7 updated 06/02/15, 21:24

Commit message

Verification of parent element ($element) type before
PageRepository::getFileReferences() call
in FilesContentObject::handleFileReferences
to avoid PHP error in case of null value

Review

  • Code review CR +2
    • Markus Klein +2
    • Alexander Opitz +1
    • Frank Nägler +1
  • Verified V +2
    • Markus Klein +2
    • Frank Nägler +1

Issues 2

Files 1

Review log 25

  1. Alina Fleser uploaded patch set 1 01/30/15, 22:18

  2. Frans Saris commented on patch set 1 CR -1 01/30/15, 23:05

    PageRepository.php:1377

    Please keep this array

    PageRepository.php:1380

    the typehinting can stay. if the passed param is NULL PHP will not complain
  3. Frans Saris commented on patch set 1 01/30/15, 23:06

    PageRepository.php:1380 Reply

    sorry my mistake, this change is ok
  4. Philipp Gampe commented on patch set 1 CR -1 01/30/15, 23:44

    Please fix the caller instead and keep the type hint. \TYPO3\CMS\Frontend\ContentObject\FilesContentObject::handleFileReferences line 317
  5. Alina Fleser uploaded patch set 2 01/31/15, 09:35

  6. Frans Saris voted on patch set 2 CR +1 01/31/15, 14:34

  7. Oliver Klee commented on patch set 2 CR -1 01/31/15, 14:41

    on it

    FilesContentObject.php:317

    Let's move this into the else.

    FilesContentObject.php:318

    This should be !== FALSE to make clear what case is covered. In addition, the space after the if is missing.
  8. Oliver Klee uploaded patch set 3 01/31/15, 14:46

  9. Oliver Klee commented on patch set 3 01/31/15, 14:47

    FilesContentObject.php:327

    By the way, do we need the addToArray if $references is empty?
  10. Alina Fleser uploaded patch set 4 02/01/15, 09:35

  11. Ingo Schmitt voted on patch set 4 CR +1 02/01/15, 09:50

  12. Oliver Klee voted on patch set 4 CR +1 02/01/15, 09:53

  13. Oliver Klee commented on patch set 4 02/01/15, 09:54

    How can we test this? Is there a unit test for this case?
  14. Oliver Klee commented on patch set 4 V -1 02/01/15, 10:12

    We need some unit tests for this so the change can be tested.
  15. Alexander Opitz commented on patch set 4 02/23/15, 13:23

    @see #62616 it isn't only FALSE it could also be NULL
  16. Markus Klein commented on patch set 4 CR -1 04/13/15, 21:43

    A useful unittest will be hard to do, so I would accept that without one.

    FilesContentObject.php:317

    $element can be NULL as noted already.
  17. Francois Suter uploaded patch set 5 06/02/15, 14:33

  18. Francois Suter commented on patch set 5 CR +1 V +1 06/02/15, 14:35

    As mentioned by Markus, the $element variable may also be NULL and not just FALSE. Since PageRepository::getFileReferences() expects an array, I propose to simply test with is_array(). Not sure if I may really vote here, since I modified the patch...
  19. Alexander Opitz voted on patch set 5 CR +1 06/02/15, 14:54

  20. Frank Nägler updated the commit message in patch set 6 06/02/15, 20:45

  21. Frank Nägler commented on patch set 6 V +1 CR +1 06/02/15, 20:45

    added second issue
  22. Alexander Opitz voted on patch set 6 CR +1 06/02/15, 20:48

  23. Markus Klein voted on patch set 6 CR +2 V +2 06/02/15, 21:24

  24. Markus Klein merged patch set 6 06/02/15, 21:24

  25. Markus Klein commented on patch set 7 06/02/15, 21:24

    Cherry Picked This patchset was cherry picked to branch TYPO3_6-2 as commit 77bc4ed11ebbdc60ff4d027013b86d385fb447f9