From d7fd6917b8ed47e6938169597c764dd31bc6fd82 Mon Sep 17 00:00:00 2001
From: Markus Klein <klein.t3@mfc-linz.at>
Date: Sun, 27 Apr 2014 19:56:48 +0200
Subject: [PATCH] [BUGFIX] checkMaximumFileUploadSize shows misleading message

Improve the Install Tool system environment check for
PHP maximum upload size.

Resolves: #58260
Releases: 6.2
Change-Id: I9f0c0694298faa817d9ac827e2f0e7f589cd0611
Reviewed-on: https://review.typo3.org/29696
Reviewed-by: Jost Baron
Tested-by: Jost Baron
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
---
 .../install/Classes/SystemEnvironment/Check.php  | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php
index e075af57ea0a..d4cdba605d9b 100644
--- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php
+++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php
@@ -184,22 +184,20 @@ class Check {
 	 */
 	protected function checkMaximumFileUploadSize() {
 		$maximumUploadFilesize = $this->getBytesFromSizeMeasurement(ini_get('upload_max_filesize'));
-		if ($maximumUploadFilesize < 1024 * 1024 * 10) {
+		$configuredMaximumUploadFilesize = 1024 * $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'];
+		if ($maximumUploadFilesize < $configuredMaximumUploadFilesize) {
 			$status = new Status\ErrorStatus();
 			$status->setTitle('PHP Maximum upload filesize too small');
 			$status->setMessage(
-				'upload_max_filesize=' . ini_get('upload_max_filesize') . LF .
-				'By default TYPO3 supports uploading, copying and moving' .
-				' files of sizes up to 10MB (you can alter the TYPO3 defaults' .
-				' with the config option TYPO3_CONF_VARS[BE][maxFileSize]).' .
-				' Your current PHP value is below this, so right now, PHP determines' .
-				' the limits for uploaded filesizes and not TYPO3.' .
+				'PHP upload_max_filesize = ' . (int)ini_get('upload_max_filesize') . ' MB' . LF .
+				'TYPO3_CONF_VARS[BE][maxFileSize] = ' . (int)($configuredMaximumUploadFilesize / 1024 / 1024) . ' MB' . LF . LF .
+				'Currently PHP determines the limits for uploaded file\'s sizes and not TYPO3.' .
 				' It is recommended that the value of upload_max_filesize is at least equal to the value' .
-				' of TYPO3_CONF_VARS[BE][maxFileSize]'
+				' of TYPO3_CONF_VARS[BE][maxFileSize].'
 			);
 		} else {
 			$status = new Status\OkStatus();
-			$status->setTitle('PHP Maximum file upload size is higher than or equal to 10MB');
+			$status->setTitle('PHP Maximum file upload size is higher than or equal to [BE][maxFileSize]');
 		}
 		return $status;
 	}
-- 
GitLab