Trigger a warning if the PHP setting "post_max_size" is lower than "max_upload_size"
authorMichael Stucki <michael.stucki@typo3.org>
Sun, 4 Feb 2007 21:40:33 +0000 (21:40 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Sun, 4 Feb 2007 21:40:33 +0000 (21:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1989 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/mod/class.tx_install.php

index b570f6a..b3af31c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
        * Changed t3lib_basicFileFunctions to use filemtime() instead of filectime()
        * Fixed bug #4526: Add td-<number> to last table elements in CSS styled content (thanks to Dimitriy Simakov)
        * !!! Enable $TYPO3_CONF_VARS[FE][pageNotFoundOnCHashError] by default. This should usually do no harm at all as long as the encryptionKey is not changed.
+       * Trigger a warning if the PHP setting "post_max_size" is lower than "max_upload_size"
 
 2007-02-04  Oliver Hader  <oh@inpublica.de>
 
index 186143a..fecaf1a 100755 (executable)
@@ -1461,7 +1461,9 @@ From sub-directory:
                                However if you cannot enable fileupload for some reason alternatively you change the default form encoding value with \$TYPO3_CONF_VARS[SYS][form_enctype].
                        ",3);
                } else $this->message($ext, 'File uploads allowed',"",-1);
+
                $upload_max_filesize = $this->convertByteSize(ini_get('upload_max_filesize'));
+               $post_max_size = $this->convertByteSize(ini_get('post_max_size'));
                if ($upload_max_filesize<10000*1024)    {
                        $this->message($ext, 'Max Upload filesize too small?',"
                                <i>upload_max_filesize=".ini_get('upload_max_filesize')."</i>
@@ -1470,6 +1472,12 @@ From sub-directory:
                                <strong>Notice:</strong> The limits for filesizes attached to database records are set in the tables.php configuration file (\$TCA) for each group/file field.
                        ",1);
                }
+               if ($upload_max_filesize > $post_max_size)      {
+                       $this->message($ext, 'Max size for POST requests is smaller than max upload filesize','
+                               <i>upload_max_filesize='.ini_get('upload_max_filesize').', post_max_size='.ini_get('post_max_size').'</i>
+                               You have defined a maximum size for file uploads which exceeds the allowed size for POST requests. Therefore the file uploads can not be larger than '.ini_get('post_max_size').'
+                       ',1);
+               }
 
                        // *****************
                        // Memory and functions