[BUGFIX] Formmail: generates incorrect file upload error in syslog 56/36256/2
authorErnesto Baschny <ernst@cron-it.de>
Tue, 17 Jul 2012 12:27:11 +0000 (14:27 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 25 Jan 2015 22:43:20 +0000 (23:43 +0100)
Change-Id: Ia0b16429e41e2aae96b3020cb690f9fedea762b0
Fixes: #39019
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/36256
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Controller/DataSubmissionController.php

index f90c7b6..09fffb9 100644 (file)
@@ -159,12 +159,28 @@ class DataSubmissionController {
                                if (!isset($_FILES[$variableName])) {
                                        continue;
                                }
-                               if (!is_uploaded_file($_FILES[$variableName]['tmp_name'])) {
-                                       Utility\GeneralUtility::sysLog('Possible abuse of DataSubmissionController: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") was not an uploaded file.', 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
+
+                               if ($_FILES[$variableName]['error'] !== UPLOAD_ERR_OK) {
+                                       Utility\GeneralUtility::sysLog(
+                                               'Error in uploaded file in DataSubmissionController: temporary file "' .
+                                                       $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") Error code: ' .
+                                                       $_FILES[$variableName]['error'],
+                                               'Core',
+                                               Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR
+                                       );
+                                       continue;
                                }
-                               if ($_FILES[$variableName]['tmp_name']['error'] !== UPLOAD_ERR_OK) {
-                                       Utility\GeneralUtility::sysLog('Error in uploaded file in DataSubmissionController: temporary file "' . $_FILES[$variableName]['tmp_name'] . '" ("' . $_FILES[$variableName]['name'] . '") Error code: ' . $_FILES[$variableName]['tmp_name']['error'], 'Core', Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR);
+
+                               if (!is_uploaded_file($_FILES[$variableName]['tmp_name'])) {
+                                       Utility\GeneralUtility::sysLog(
+                                               'Possible abuse of DataSubmissionController: temporary file "' . $_FILES[$variableName]['tmp_name'] .
+                                                       '" ("' . $_FILES[$variableName]['name'] . '") was not an uploaded file.',
+                                               'Core',
+                                               Utility\GeneralUtility::SYSLOG_SEVERITY_ERROR
+                                       );
+                                       continue;
                                }
+
                                $theFile = Utility\GeneralUtility::upload_to_tempfile($_FILES[$variableName]['tmp_name']);
                                $theName = $_FILES[$variableName]['name'];
                                if ($theFile && file_exists($theFile)) {