Fixed bug #7445: Malformed translated locallang causes PHP crash (thanks to Francois...
authorBenni Mack <benni.mack@typo3.org>
Fri, 22 Feb 2008 15:47:26 +0000 (15:47 +0000)
committerBenni Mack <benni.mack@typo3.org>
Fri, 22 Feb 2008 15:47:26 +0000 (15:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3253 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 5c9ef11..894facd 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-22  Benjamin Mack  <mack@xnos.org>
+
+       * Fixed bug #7445: Malformed translated locallang causes PHP crash (thanks to Francois Suter)
+
 2008-02-22  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Added feature #7526: Making loginNews look nicer (Thanks to Steffen Kamper)
 2008-02-22  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Added feature #7526: Making loginNews look nicer (Thanks to Steffen Kamper)
index e201318..68b27b5 100755 (executable)
@@ -3869,8 +3869,8 @@ class t3lib_div {
                                        // Read XML, parse it.
                                $xmlString = t3lib_div::getUrl($fileRef);
                                $xmlContent = t3lib_div::xml2array($xmlString);
                                        // Read XML, parse it.
                                $xmlString = t3lib_div::getUrl($fileRef);
                                $xmlContent = t3lib_div::xml2array($xmlString);
-                               if (!is_array($xmlContent))     {
-                                       die('\''.$fileRef.'\' is no TYPO3 language file)!');
+                               if (!is_array($xmlContent)) {
+                                       die('The file "'.$fileRef.'" is no TYPO3 language file!');
                                }
 
                                        // Set default LOCAL_LANG array content:
                                }
 
                                        // Set default LOCAL_LANG array content:
@@ -3934,6 +3934,9 @@ class t3lib_div {
                                                        // Read and parse XML content:
                                                $local_xmlString = t3lib_div::getUrl($localized_file);
                                                $local_xmlContent = t3lib_div::xml2array($local_xmlString);
                                                        // Read and parse XML content:
                                                $local_xmlString = t3lib_div::getUrl($localized_file);
                                                $local_xmlContent = t3lib_div::xml2array($local_xmlString);
+                                               if (!is_array($local_xmlContent)) {
+                                                       die('The file "'.$localized_file.'" is no TYPO3 language file!');
+                                               }
                                                $LOCAL_LANG[$langKey] = is_array($local_xmlContent['data'][$langKey]) ? $local_xmlContent['data'][$langKey] : array();
 
                                                        // Checking if charset should be converted.
                                                $LOCAL_LANG[$langKey] = is_array($local_xmlContent['data'][$langKey]) ? $local_xmlContent['data'][$langKey] : array();
 
                                                        // Checking if charset should be converted.
@@ -4903,4 +4906,4 @@ class t3lib_div {
                return '\''.$value.'\'';
        }
 }
                return '\''.$value.'\'';
        }
 }
-?>
\ No newline at end of file
+?>