Bug #60998

PageRepository::shouldFieldBeOverlaid raises PHP warning

Added by Stefan Rotsch almost 7 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2014-08-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

With TYPO3 6.2.4, the sys_log shows a lot of PHP warnings:

Core: Error handler (FE): PHP Warning: trim() expects parameter 1 to be string, array given in [...]/typo3/sysext/frontend/Classes/Page/PageRepository.php line 1416

When looking at the shouldFieldBeOverlaid method, the PHPDoc comment states the type of $value being "mixed":

1396:      * @param mixed $value Current value of the field

$value is assigned to $checkValue later:

1409:    $checkValue = $value;

Then the critical trim() is executed without verifying the type of $checkValue:

1416:    if (trim($checkValue) === '') {
1417:        $shouldFieldBeOverlaid = FALSE;
1418:    }

At some point there should be a type check against $checkValue instead of assuming it to be a string.


Files

Screen Shot 2014-10-24 at 09.08.10.png (161 KB) Screen Shot 2014-10-24 at 09.08.10.png Lars Malach, 2014-10-24 09:28
pages_language_overlay_meida.png (129 KB) pages_language_overlay_meida.png Florian Engelke, 2015-03-18 10:19
Uncaught TYPO3 Exception.txt (11.9 KB) Uncaught TYPO3 Exception.txt Florian Engelke, 2015-03-18 16:50

Related issues

Related to TYPO3 Core - Bug #58352: Invalid localization overlay of cObject FILESClosedOliver Hader2014-04-30

Actions
Related to TYPO3 Core - Bug #47869: Failed localization of FILES content object related to pagesClosedEugene Skomorokhov2013-05-03

Actions
Precedes TYPO3 Core - Bug #65800: PageRepository::shouldFieldBeOverlaid raises PHP warning - FileReferenceClosed2015-03-18

Actions

Also available in: Atom PDF