Skip to content
Snippets Groups Projects
Commit f39c2f1c authored by Sascha Egerer's avatar Sascha Egerer
Browse files

[BUGFIX] Initialize TSFE->config with correct type in PHP 7.1

The TypoScriptFrontendController->config variable must be of type
array but is initialized with an empty string. Since PHP 7.1 there is
a different handling of invalid array usage. If a variable is
accessed as an array but is not an array the value of that variable
becomes a string 'A'.

PHP 7
php > $config = '';
php > $config['foo'] = 'bar';
php > print_r($config)
Array
(
    [foo] => bar
)

PHP 7.1
php > $config = '';
php > $config['foo'] = 'bar';
> Warning: Illegal string offset 'foo' in php shell code on line 1
php > print_r($config)
A

Related PHP "Bug" (It's not a bug, it's a feature)
https://bugs.php.net/bug.php?id=73081

Change-Id: I6d5b75ed60f0506ecacdead01a318fdc26757394
Resolves: #79052
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/51302


Reviewed-by: default avatarMathias Brodala <mbrodala@pagemachine.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarFrans Saris <franssaris@gmail.com>
Tested-by: default avatarFrans Saris <franssaris@gmail.com>
Tested-by: default avatarMona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
Tested-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
parent d827be67
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment