Fix bug #3725: empty and invalid flexform meta data are checked. impexp echos warning...
authorFranz Holzinger <holzinger@ttproducts.de>
Fri, 30 Jun 2006 15:23:44 +0000 (15:23 +0000)
committerFranz Holzinger <holzinger@ttproducts.de>
Fri, 30 Jun 2006 15:23:44 +0000 (15:23 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1584 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_flexformtools.php
typo3/sysext/impexp/class.tx_impexp.php

index e6ea532..ed6744d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-30  Franz Holzinger <kontakt@fholzinger.com>
+
+       * Fix bug #3725: empty and invalid flexform meta data are checked. impexp echos warning message found inside T3D import.
+
 2006-06-30  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * t3lib_htmlmail: auto-detect charset (using FE or BE settings) with manual override
index 9d57a99..9266b0e 100644 (file)
@@ -138,6 +138,10 @@ class t3lib_flexformtools {
                        $langChildren = $dataStructArray['meta']['langChildren'] ? 1 : 0;
                        $langDisabled = $dataStructArray['meta']['langDisable'] ? 1 : 0;
 
+                          // empty or invalid <meta>
+                       if (!is_array($editData['meta']))       {
+                          $editData['meta'] = array();
+                       }
                        $editData['meta']['currentLangId'] = array();
                        $languages = $this->getAvailableLanguages();
 
index b3f3dfd..5e652fb 100755 (executable)
@@ -2266,18 +2266,20 @@ class tx_impexp {
                        // getting header data
                $initStr = fread($fd, $initStrLen);
                $initStrDat = explode(':',$initStr);
-               if (!strcmp($initStrDat[3],'')) {
-                       $datString = fread($fd,intval($initStrDat[2]));
-                       fread($fd,1);
-                       if (!strcmp(md5($datString), $initStrDat[0]))   {
-                               if ($initStrDat[1])     {
-                                       if ($this->compress)    {
-                                               $datString = gzuncompress($datString);
-                                       } else $this->error('Content read error: This file requires decompression, but this server does not offer gzcompress()/gzuncompress() functions.',1);
-                               }
-                               return $unserialize ? unserialize($datString) : $datString;
-                       } else $this->error('MD5 check failed ('.$name.')');
-               } else $this->error('File read error: InitString had a wrong length. ('.$name.')');
+               if (strstr($initStrDat[0],'Warning') == FALSE)  {
+                       if (!strcmp($initStrDat[3],'')) {
+                               $datString = fread($fd,intval($initStrDat[2]));
+                               fread($fd,1);
+                               if (!strcmp(md5($datString), $initStrDat[0]))   {
+                                       if ($initStrDat[1])     {
+                                               if ($this->compress)    {
+                                                       $datString = gzuncompress($datString);
+                                               } else $this->error('Content read error: This file requires decompression, but this server does not offer gzcompress()/gzuncompress() functions.',1);
+                                       }
+                                       return $unserialize ? unserialize($datString) : $datString;
+                               } else $this->error('MD5 check failed ('.$name.')');
+                       } else $this->error('File read error: InitString had a wrong length. ('.$name.')');
+               } else $this->error('File read error: Warning message in file. ('.$initStr.fgets($fd).')');
        }
 
        /**