From e172269f8db8720083c1e74eca03d9662a331185 Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Sun, 27 Jul 2014 22:44:50 +0200 Subject: [PATCH] [BUGFIX] Refine the error message of checkMaximumFileUploadSize MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The Install Tool check the PHP configuration for the maximum file upload size within the checkMaximumFileUploadSize() method. This method issues an error message in case the values do not fit. The error message outputs the values in MB which might give a wrong indication to the user, as the values seem to be equal although the check complains they are not. Provide better output by giving those numbers in KB rather than MB, which will show diverging numbers correctly then. Resolves: #60627 Releases: 6.3, 6.2 Change-Id: I5faa4ceb4d7279278182716c31bf6d6dcb851052 Reviewed-on: http://review.typo3.org/31873 Reviewed-by: Christian Hünniger Tested-by: Christian Hünniger Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters --- typo3/sysext/install/Classes/SystemEnvironment/Check.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php index f5a3de29732c..63f7e04ebdf0 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php @@ -175,13 +175,13 @@ class Check { */ protected function checkMaximumFileUploadSize() { $maximumUploadFilesize = $this->getBytesFromSizeMeasurement(ini_get('upload_max_filesize')); - $configuredMaximumUploadFilesize = 1024 * $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize']; + $configuredMaximumUploadFilesize = 1024 * (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize']; if ($maximumUploadFilesize < $configuredMaximumUploadFilesize) { $status = new Status\ErrorStatus(); $status->setTitle('PHP Maximum upload filesize too small'); $status->setMessage( - 'PHP upload_max_filesize = ' . (int)ini_get('upload_max_filesize') . ' MB' . LF . - 'TYPO3_CONF_VARS[BE][maxFileSize] = ' . (int)($configuredMaximumUploadFilesize / 1024 / 1024) . ' MB' . LF . LF . + 'PHP upload_max_filesize = ' . (int)($maximumUploadFilesize / 1024) . ' KB' . LF . + 'TYPO3_CONF_VARS[BE][maxFileSize] = ' . (int)($configuredMaximumUploadFilesize / 1024) . ' KB' . 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].' @@ -1331,6 +1331,6 @@ class Check { } elseif (stripos($measurement, 'K')) { $bytes *= 1024; } - return $bytes; + return (int)$bytes; } } -- 2.20.1