Issue Bug Closed

#19589Cannot use string offset as an array in function tslib_pibase()

Tania 11/10/08, 23:37 updated 09/09/13, 10:20

Description

Since 4.2.0 i have found this error as PHP5 is more restricted about the use of arrays and I just checked in 4.2.2 and the error is still there.

/tslib/class.tslib_pibase.php
LINES 221 and 808

The error says:

Fatal error: Cannot use string offset as an array in …/typo3_src-4.2.2/typo3/sysext/cms/tslib/class.tslib_pibase.php on line 221

Line 221:

if ($GLOBALS[‘TSFE’]->config[‘config’][‘language’]) {
$this->LLkey = $GLOBALS[‘TSFE’]->config[‘config’][‘language’];
if ($GLOBALS[‘TSFE’]->config[‘config’][‘language_alt’]) {
$this->altLLkey = $GLOBALS[‘TSFE’]->config[‘config’][‘language_alt’];
}
}

The quick fix would be:

$configTSFE = $GLOBALS[‘TSFE’]->config[‘config’];
if ($configTSFE[‘language’]) {
…

And the same for line 808

(issue imported from #M9765)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.