Bug #18161
closedMalformed translated locallang causes PHP crash
0%
Description
In t3lib_div::readLLXMLfile() errors in the locallang file are properly caught for the default language (i.e. an error message is displayed pointing to the invalid file), but not for translations (PHP fatal error occurs).
The attached patch copies for the translated file the same mechanism as for the default language file.
To reproduce that bug, you can simply replace a locallang file in typo3conf/l10n by an empty and see what happens. For example replace typo3conf/l10n/lang/[language_key].locallang_general.xml and try to view the page tree in the BE by going to Web > Page.
(issue imported from #M7445)
Files
Updated by Francois Suter almost 17 years ago
Sorry filepath is:
typo3conf/l10n/[language_key]/lang/[language_key].locallang_general.xml
Updated by Benni Mack almost 17 years ago
Hey Francois. Can you point me to the place where this behaviour exists for the default language?
Updated by Francois Suter almost 17 years ago
A few lines above in t3lib_div::readLLXMLfile(), starting at line 3830, you have the following:
$xmlString = t3lib_div::getUrl($fileRef);
$xmlContent = t3lib_div::xml2array($xmlString);
if (!is_array($xmlContent)) {
die('\''.$fileRef.'\' is no TYPO3 language file)!');
}
This correctly handles errors for a locallang file in the default language. I just reproduced the same mechanism for translated files.
Updated by Benni Mack almost 17 years ago
Thanks a lot. I will have a look at the patch tomorrow. Looks quite straightforward.