Project

General

Profile

Actions

Bug #93345

open

Exception when image with 0 bytes is used for click enlarge

Added by Torben Hansen over 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2021-01-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 = 1 must be set
  • User uploads an image file test.jpg which 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

Reason:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L3999

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87784: ClickEnlargeViewHelper causes error "Object of class FileReference could not be converted to string in TemplateService.php line 1441"Closed2019-02-25

Actions
Actions

Also available in: Atom PDF