Fixed bug #4888: Invalid argument supplied for foreach().
authorAndreas Otto <andreas.otto@dkd.de>
Thu, 23 Aug 2007 10:06:28 +0000 (10:06 +0000)
committerAndreas Otto <andreas.otto@dkd.de>
Thu, 23 Aug 2007 10:06:28 +0000 (10:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2455 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_install.php

index eb48a8c..80dd864 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-08-23 Andreas Otto <andreas.otto@dkd.de>
+
+       * (trivial) Fixed bug #4888:  Invalid argument supplied for foreach().
+
 2007-08-21 Andreas Otto <andreas.otto@dkd.de>
 
        * Feature request #5748: Introduced a new TS option that makes indexing of metatags configurable. Adapted code to make use of the new TS option.
index 7806177..3fa5b02 100755 (executable)
@@ -390,17 +390,19 @@ class t3lib_install {
                                                                                )
                                                                        );
                                                                                // Change key definition if necessary (must use "prefix" on TEXT columns)
-                                                                       foreach ($cfg['keys'] as $kN => $kType) {
-                                                                               $match = array();
-                                                                               preg_match('/^([^(]*)\(([^)]+)\)(.*)/', $kType, $match);
-                                                                               $keys = array();
-                                                                               foreach (t3lib_div::trimExplode(',',$match[2]) as $kfN) {
-                                                                                       if ($fN == $kfN)        {
-                                                                                               $kfN .= '('.$newSize.')';
+                                                                       if ( is_array($cfg['keys']) ) {
+                                                                               foreach ($cfg['keys'] as $kN => $kType) {
+                                                                                       $match = array();
+                                                                                       preg_match('/^([^(]*)\(([^)]+)\)(.*)/', $kType, $match);
+                                                                                       $keys = array();
+                                                                                       foreach (t3lib_div::trimExplode(',',$match[2]) as $kfN) {
+                                                                                               if ($fN == $kfN)        {
+                                                                                                       $kfN .= '('.$newSize.')';
+                                                                                               }
+                                                                                               $keys[] = $kfN;
                                                                                        }
-                                                                                       $keys[] = $kfN;
+                                                                                       $total[$table]['keys'][$kN] = $match[1].'('.join(',',$keys).')'.$match[3];
                                                                                }
-                                                                               $total[$table]['keys'][$kN] = $match[1].'('.join(',',$keys).')'.$match[3];
                                                                        }
                                                                }
                                                        break;