Project

General

Profile

Actions

Bug #60998

closed

PageRepository::shouldFieldBeOverlaid raises PHP warning

Added by Stefan Rotsch over 9 years ago. Updated over 5 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


Related issues 3 (0 open3 closed)

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
Actions

Also available in: Atom PDF