[BUGFIX] Initialize TSFE->config with correct type in PHP 7.1 71/51371/2
authorSascha Egerer <sascha@sascha-egerer.de>
Fri, 13 Jan 2017 09:00:16 +0000 (10:00 +0100)
committerSascha Egerer <sascha@sascha-egerer.de>
Fri, 20 Jan 2017 12:05:37 +0000 (13:05 +0100)
commitdad72d3ff7a12ffeddcb9bc43f19428ba6f41c23
tree06409e19b4cd0476c5e9cdd20c4a89fb424aec7a
parent2920ac9130a383358a356701b226e6975aaf9e20
[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: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
(cherry picked from commit f39c2f1c0fcf92c8c4923f9a4e77cc0631834fd5)
Reviewed-on: https://review.typo3.org/51371
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php