[BUGFIX] checkMaximumFileUploadSize shows misleading message 96/29696/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 27 Apr 2014 17:56:48 +0000 (19:56 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 30 Apr 2014 17:40:54 +0000 (19:40 +0200)
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
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index e075af5..d4cdba6 100644 (file)
@@ -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;
        }