From 8a91b50d6a884e1556c025f35b0ab7b5f4325af9 Mon Sep 17 00:00:00 2001 From: Andreas Bouche Date: Thu, 3 Mar 2016 22:33:36 +0100 Subject: [PATCH] [BUGFIX] Avoid error message on unlimited upload_max_filesize Resolves: #73214 Releases: master, 7.6 Change-Id: I9496964ffd9daeb2c330f022c876f6aceacced1c Reviewed-on: https://review.typo3.org/47029 Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../sysext/backend/Resources/Public/JavaScript/DragUploader.js | 2 +- typo3/sysext/core/Classes/Resource/ResourceStorage.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js b/typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js index d63c285c5553..6f48c47b3f89 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js @@ -542,7 +542,7 @@ define(['jquery', me.$iconCol.html(' ') // check file size - if (me.file.size > me.dragUploader.maxFileSize) { + if (me.dragUploader.maxFileSize > 0 && me.file.size > me.dragUploader.maxFileSize) { me.updateMessage(TYPO3.lang['file_upload.maxFileSizeExceeded'] .replace(/\{0\}/g, me.file.name) .replace(/\{1\}/g, DragUploader.fileSizeAsString(me.dragUploader.maxFileSize))); diff --git a/typo3/sysext/core/Classes/Resource/ResourceStorage.php b/typo3/sysext/core/Classes/Resource/ResourceStorage.php index 3a5388915565..208bc49b1391 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceStorage.php +++ b/typo3/sysext/core/Classes/Resource/ResourceStorage.php @@ -938,7 +938,7 @@ class ResourceStorage implements ResourceStorageInterface } // Max upload size (kb) for files. $maxUploadFileSize = GeneralUtility::getMaxUploadFileSize() * 1024; - if ($uploadedFileSize >= $maxUploadFileSize) { + if ($maxUploadFileSize > 0 && $uploadedFileSize >= $maxUploadFileSize) { unlink($localFilePath); throw new Exception\UploadSizeException('The uploaded file exceeds the size-limit of ' . $maxUploadFileSize . ' bytes', 1322110041); } -- 2.20.1