Review TYPO3_7-6 Merged

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

Sascha Egerer CR +2 V +2 Easy +3 −3 updated 01/20/17, 12:05

Commit message

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

Review

  • Code review CR +2
    • Sascha Egerer +2
  • Verified V +2
    • Sascha Egerer +2
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 34

  1. Sascha Egerer commented on patch set 1 01/20/17, 11:50

    Cherry Picked from branch master.
  2. TYPO3com voted on patch set 1 V +1 01/20/17, 11:57 Completed build in 06m 26s on Fri, 20 Jan, 12:57 PM Test Summary: 37679 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC76-642

  3. Sascha Egerer voted on patch set 1 CR +2 V +2 01/20/17, 12:05

  4. Gerrit merged patch set 1 01/20/17, 12:05