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 #1

Updated by Frans Saris almost 10 years ago

  • Category set to File Abstraction Layer (FAL)

Add a early return to getFileReferences() if given value isn't a array

Actions #2

Updated by Mathias Schreiber almost 10 years ago

  • Target version changed from next-patchlevel to 7.1 (Cleanup)
  • Sprint Focus set to On Location Sprint
Actions #3

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #4

Updated by Gerrit Code Review almost 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #5

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #6

Updated by Gerrit Code Review almost 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #7

Updated by Gerrit Code Review over 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #8

Updated by Francois Suter over 9 years ago

  • Target version changed from 7.1 (Cleanup) to next-patchlevel
Actions #9

Updated by Francois Suter over 9 years ago

I changed the target version, because this one has to go into 6.2 too.

Actions #10

Updated by Gerrit Code Review over 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36480

Actions #11

Updated by Frank Nägler over 9 years ago

  • Target version changed from next-patchlevel to 6.2.13
  • Sprint Focus changed from On Location Sprint to Stabilization Sprint
Actions #12

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39905

Actions #13

Updated by Alina Fleser over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF