Review main Merged

69729[BUGFIX] Handle invalid source string correctly in ImageService

Oli Bartsch CR +2 V +2 Easy +8 −3 updated 07/09/21, 08:20

Commit message

The ImageService->getImageFromSourceString() tries
to retrieve a FileInterface from a given source string,
e.g. with the "EXT:" prefix. However, because the used
ResourceFactory->retrieveFileOrFolderObject() method
can also return a FolderInterface or NULL, this must be
handled to prevent a TypeError.

Therefore, the final $image value is now checked for being
a FileInterface. Otherwise NULL is returned, which is then
handled with a custom exception in the calling `getImage()`
method.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Geert Boetzkes +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1013

  1. Oli Bartsch uploaded patch set 1 07/06/21, 15:39

  2. Oli Bartsch uploaded patch set 2 07/06/21, 15:41

  3. core-ci voted on patch set 1 V +1 07/06/21, 15:48 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13026

  4. core-ci voted on patch set 2 V +1 07/06/21, 15:53 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13027

  5. Jochen Roth commented on patch set 2 07/06/21, 16:29

    ImageService.php:180

    > ... could also be a Folder Interface
  6. Oli Bartsch uploaded patch set 3 07/06/21, 20:23

  7. core-ci voted on patch set 3 V +1 07/06/21, 20:38 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13034

  8. Oli Bartsch commented on patch set 3 07/06/21, 20:40

    ImageService.php:180 Reply

    Done
  9. Geert Boetzkes voted on patch set 3 CR +1 07/07/21, 09:03

  10. Jochen Roth voted on patch set 3 V +1 CR +1 07/07/21, 09:38

  11. Benni Mack voted on patch set 3 V +1 CR +1 07/09/21, 07:51

  12. Oli Bartsch voted on patch set 3 V +2 CR +2 07/09/21, 08:20

  13. Oli Bartsch merged patch set 4 07/09/21, 08:20