Review 10.4 Merged

69772[BUGFIX] Handle invalid source string correctly in ImageService

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

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
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Oli Bartsch commented on patch set 1 07/09/21, 08:21

    Cherry Picked from branch master.
  2. core-ci voted on patch set 1 V +1 07/09/21, 08:29 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/13125

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

  4. Oli Bartsch merged patch set 2 07/09/21, 09:12