* Fixed bug 8941: Fixed an uninitialized array that might lead to PHP warning (Thanks...
authorMichael Stucki <michael.stucki@typo3.org>
Fri, 11 Jul 2008 10:12:00 +0000 (10:12 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Fri, 11 Jul 2008 10:12:00 +0000 (10:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3871 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index 761ee7f..933fcab 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-07-11  Michael Stucki  <michael@typo3.org>
+
+       * Fixed bug 8941: Fixed an uninitialized array that might lead to PHP warning (Thanks to Ralf Hettinger)
+
 2008-07-09  Oliver Hader  <oliver@typo3.org>
 
        * Fixed bug #8851: navFrameScript is not loaded for submodules (thanks to Christian Ehret)
index 13244b6..6dbe903 100755 (executable)
@@ -5065,12 +5065,15 @@ class tslib_cObj {
 
                if (is_array($TCA[$table]) && is_array($TCA[$table]['columns'][$field]) && is_array($TCA[$table]['columns'][$field]['config']['items'])) {
                        $values = t3lib_div::trimExplode(',',$inputValue);
-                       foreach ($values as $value)     {
+                       $output = array();
+                       foreach ($values as $value) {
                                        // Traverse the items-array...
                                reset($TCA[$table]['columns'][$field]['config']['items']);
-                               while(list($key,$item)=each($TCA[$table]['columns'][$field]['config']['items']))        {
+                               while (list($key,$item)=each($TCA[$table]['columns'][$field]['config']['items'])) {
                                                // ... and return the first found label where the value was equal to $key
-                                       if (!strcmp($item[1],trim($value)))     $output[] = $GLOBALS['TSFE']->sL($item[0]);
+                                       if (!strcmp($item[1],trim($value))) {
+                                               $output[] = $GLOBALS['TSFE']->sL($item[0]);
+                                       }
                                }
                        }
                        $returnValue = implode($delimiter,$output);