[FOLLOWUP][BUGFIX] Clean up inconsistent data from import 13/46013/2
authorBernhard Kraft <kraft@webconsulting.at>
Sat, 16 Jan 2016 13:37:57 +0000 (13:37 +0000)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 16 Jan 2016 13:55:10 +0000 (14:55 +0100)
When importing a T3D or XML file the loaded data has to get cleansed
first. The "extensionDependencies" array for example may contain an
empty string which will cause a non-correct warning message in the
importers warning tab.

A new method "cleanupImportData" takes care to bring import data into
an acceptable format.

Resolves: #72761
Releases: master, 7.6
Change-Id: I314d5702bf07bb57e723d3b11f5e848cba1c7808
Reviewed-on: https://review.typo3.org/46013
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/impexp/Classes/Import.php

index faea558..73b87b0 100644 (file)
@@ -2121,7 +2121,11 @@ class Import extends ImportExport
      */
     protected function cleanupImportData()
     {
-        $this->dat['header']['extensionDependencies'] = array_filter($this->dat['header']['extensionDependencies']);
+        if (is_array($this->dat['header']['extensionDependencies'])) {
+            $this->dat['header']['extensionDependencies'] = array_filter($this->dat['header']['extensionDependencies']);
+        } else {
+            $this->dat['header']['extensionDependencies'] = array();
+        }
     }
 
     /**