[BUGFIX] Initialize ExtendedFileUtility only if an actual upload happens 67/45967/2
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 14 Jan 2016 10:03:49 +0000 (11:03 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 15 Jan 2016 20:20:08 +0000 (21:20 +0100)
There is no need to initialize ExtendedFileUtility every request in
EXT:impexp. Check if an upload is actually performed.

Change-Id: I45ff2affd38cf00b3e182741749fb567f6853658
Resolves: #72692
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/45967
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/impexp/Classes/Controller/ImportExportController.php

index dfc3ebb..ca9ee95 100644 (file)
@@ -170,7 +170,6 @@ class ImportExportController extends BaseScriptClass
         $inData = GeneralUtility::_GP('tx_impexp');
         $this->content .= '<h3>' . $this->lang->getLL('title_' . (string)$inData['action'], true) . '</h3>';
         $this->content .= '<div style="padding-top: 5px;"></div>';
-        $this->checkUpload();
         switch ((string)$inData['action']) {
             case 'export':
                 $this->shortcutName = $this->lang->getLL('title_export');
@@ -183,6 +182,9 @@ class ImportExportController extends BaseScriptClass
                 break;
             case 'import':
                 $this->shortcutName = $this->lang->getLL('title_import');
+                if (GeneralUtility::_POST('_upload')) {
+                    $this->checkUpload();
+                }
                 // Finally: If upload went well, set the new file as the import file:
                 if (!empty($this->uploadedFiles[0])) {
                     // Only allowed extensions....