Project

General

Profile

Actions

Bug #64239

closed

Catchable fatal error in PageRepository::getFileReferences() if no reference exists

Added by Jacob Rasmussen almost 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2015-01-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:
Stabilization Sprint

Description

Due to a missing check on the type of $element in TYPO3\CMS\Frontend\ContentObject\FilesContentObject->handleFileReferences(), it is possible to crash page rendering.

By using a configuration like below

10 = FILES
10 {
    references {
        table = tx_someforeign_table
        uid.field = identifier_field
        fieldName = reference_field_name
    }
    renderObj = IMAGE
    renderObj.file {
        import.data = file:current:uid
        treatIdAsReference = 1
    }
}

And having a NULL / empty value in the identifier_field, a fatal error is triggered.

PHP Catchable fatal error: Argument 3 passed to TYPO3\\CMS\\Frontend\\Page\\PageRepository::getFileReferences() must be of the type array, null given, called in /var/www/typo3_src/TYPO3_6-2/typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php on line 317 and defined in /var/www/typo3_src/TYPO3_6-2/typo3/sysext/frontend/Classes/Page/PageRepository.php on line 1357

Since I'm no FAL expert, my best guess is to quit the function if $element isn't an array before calling getFileReferences - but I would like some feedback before starting on a patch


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62616: Catchable fatal error (null given) in FilesContentObjectClosed2014-11-01

Actions
Actions

Also available in: Atom PDF