Fixed issue #13670: Performance optimization: change while(list() to foreach() (thank...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_cs.php
index 2524acd..bdacd5d 100644 (file)
@@ -646,7 +646,7 @@ class t3lib_cs {
        }
 
        /**
-        * Convert all elements in ARRAY from one charset to another charset.
+        * Convert all elements in ARRAY with type string from one charset to another charset.
         * NOTICE: Array is passed by reference!
         *
         * @param       string          Input array, possibly multidimensional
@@ -660,7 +660,7 @@ class t3lib_cs {
                foreach($array as $key => $value)       {
                        if (is_array($array[$key]))     {
                                $this->convArray($array[$key],$fromCS,$toCS,$useEntityForNoChar);
-                       } else {
+                       } elseif (is_string($array[$key])) {
                                $array[$key] = $this->conv($array[$key],$fromCS,$toCS,$useEntityForNoChar);
                        }
                }
@@ -987,7 +987,7 @@ class t3lib_cs {
                                        $this->parsedCharsets[$charset]=unserialize(t3lib_div::getUrl($cacheFile));
                                } else {
                                                // Parse conversion table into lines:
-                                       $lines=t3lib_div::trimExplode(chr(10),t3lib_div::getUrl($charsetConvTableFile),1);
+                                       $lines=t3lib_div::trimExplode(LF,t3lib_div::getUrl($charsetConvTableFile),1);
                                                // Initialize the internal variable holding the conv. table:
                                        $this->parsedCharsets[$charset]=array('local'=>array(),'utf8'=>array());
                                                // traverse the lines: