From 3822a8c9d1ebacbc263933d69edd86ca00098f28 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Thu, 14 Jan 2016 11:03:49 +0100
Subject: [PATCH] [BUGFIX] Initialize ExtendedFileUtility only if an actual
 upload happens

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
Reviewed-on: https://review.typo3.org/45878
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
---
 .../impexp/Classes/Controller/ImportExportController.php      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
index 0e84ba63aef6..68537c78f9e3 100644
--- a/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
+++ b/typo3/sysext/impexp/Classes/Controller/ImportExportController.php
@@ -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');
@@ -179,6 +178,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....
-- 
GitLab