Skip to content
Snippets Groups Projects
Commit 225b0809 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Handle invalid source string correctly in ImageService

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.

Resolves: #94495
Releases: master, 10.4
Change-Id: I95836fd3c1701cc8c9b9e07c5b8e10a7fb9ee9cc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69729


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarJochen <rothjochen@gmail.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarGeert Boetzkes <geert.boetzkes@beech.it>
Reviewed-by: default avatarJochen <rothjochen@gmail.com>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent cf55f1de
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment