Bug #88879

ContentObjectRenderer->imageLinkWrap could fail if ResourceFactory returns NULL instead of File

Added by Kevin Ditscheid 3 months ago. Updated 2 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-08-01
Due date:
% Done:

0%

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

Description

This line https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L1319 could fail, if the ResourceFactory returned NULL earlier in execution at https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L1290

It should probably be hardened, so this possibility of a NULL value is respected instead of the code breaking.

History

#1 Updated by Frank Naegler 2 months ago

  • Status changed from New to Needs Feedback

Can you please post a stack trace or some more details.
The mentioned lines make no sense.

#2 Updated by Kevin Ditscheid 2 months ago

Give the imageLinkWrap function a file in a processed directory. typo3temp/assets/_processed_/somefile.jpg for example.
The ResourceFactory will return NULL and all the stuff will fall apart, because there is no File object created and the successfull creation of that object is never checked.
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/ResourceFactory.php#L426

#3 Updated by Kevin Ditscheid 2 months ago

Also, if you give it a ProcessedFile object, it will complain about the identifier later in execution.

Also available in: Atom PDF