#93345Exception when image with 0 bytes is used for click enlarge
Description
This edge case issue occurred after a TYPO3 8.7 to 10.4 migration.
How to reproduce:
- TypoScript Constant
styles.content.textmedia.linkWrap.lightboxEnabled = 1must be set - User uploads an image file
test.jpgwhich has a size of 0 bytes - User uses the uploaded image in a image content element
- User sets the file width or height in the content element to a various integer (e.g.
100) - User selects the “Click-Enlarge” option
Opening the page with the image content element will result in an exception.
PHP Catchable Fatal Error: Object of class TYPO3\CMS\Core\Resource\FileReference could not be converted to string in /path/to/typo3/typo3_src-10.4.12/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 4454
isImage() returns false since the file is 0 bytes and then the FilePathSanitizer tries to typecast the file variable (which is a FileReference) to a string.