Fixing some missing is_array checks
authorWolfgang Klinger <wolfgang@stufenlos.net>
Thu, 13 Jul 2006 12:33:25 +0000 (12:33 +0000)
committerWolfgang Klinger <wolfgang@stufenlos.net>
Thu, 13 Jul 2006 12:33:25 +0000 (12:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1633 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/dbal/class.ux_t3lib_db.php

index 44033a8..49e87d6 100644 (file)
@@ -255,16 +255,18 @@ class ux_t3lib_DB extends t3lib_DB {
         */
        function analyzeFields($parsedExtSQL) {
                foreach($parsedExtSQL as $table => $tdef) {
-                       foreach($tdef['fields'] as $field => $fdef) {
-                               $fdef = $this->SQLparser->parseFieldDef($fdef);
-                               $this->cache_fieldType[$table][$field]['type'] = $fdef['fieldType'];
-                               $this->cache_fieldType[$table][$field]['metaType'] = $this->MySQLMetaType($fdef['fieldType']);
-                               $this->cache_fieldType[$table][$field]['notnull'] = (isset($fdef['featureIndex']['NOTNULL']) && !$this->SQLparser->checkEmptyDefaultValue($fdef['featureIndex'])) ? 1 : 0;
-                               if(isset($fdef['featureIndex']['AUTO_INCREMENT'])) {
-                                       $this->cache_autoIncFields[$table] = $field;
-                               }
-                               if(isset($tdef['keys']['PRIMARY'])) {
-                                       $this->cache_primaryKeys[$table] = substr($tdef['keys']['PRIMARY'], 13, -1);
+                       if (is_array($tdef['fields'])) {
+                               foreach($tdef['fields'] as $field => $fdef) {
+                                       $fdef = $this->SQLparser->parseFieldDef($fdef);
+                                       $this->cache_fieldType[$table][$field]['type'] = $fdef['fieldType'];
+                                       $this->cache_fieldType[$table][$field]['metaType'] = $this->MySQLMetaType($fdef['fieldType']);
+                                       $this->cache_fieldType[$table][$field]['notnull'] = (isset($fdef['featureIndex']['NOTNULL']) && !$this->SQLparser->checkEmptyDefaultValue($fdef['featureIndex'])) ? 1 : 0;
+                                       if(isset($fdef['featureIndex']['AUTO_INCREMENT'])) {
+                                               $this->cache_autoIncFields[$table] = $field;
+                                       }
+                                       if(isset($tdef['keys']['PRIMARY'])) {
+                                               $this->cache_primaryKeys[$table] = substr($tdef['keys']['PRIMARY'], 13, -1);
+                                       }
                                }
                        }
                }