Issue Bug Closed

#19568Fatal error on the function readLLXMLfile of the class t3lib_div

Antonio Alvarez 11/04/08, 14:53 updated 10/02/18, 12:29

Description

The next fatal error happens in the function readLLXMLfile of the class t3lib_div, crashing all the website.

Fatal error: Cannot use string offset as an array in /var/www/typo3_src-4.1.3/t3lib/class.t3lib_div.php on line 4199

It seems a bug in PHP5: http://bugs.php.net/bug.php?id=32621

The solution is modify the line 4199:

$LOCAL_LANG[$langKey] = is_array($local_xmlContent[‘data’][$langKey]) ? $local_xmlContent[‘data’][$langKey] : array();

…and put this:

$LOCAL_LANG[$langKey] = (is_array($local_xmlContent[‘data’]) && is_array($local_xmlContent[‘data’][$langKey])) ? $local_xmlContent[‘data’][$langKey] : array();

(issue imported from #M9732)

Reviews 0

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