From: kink Date: Mon, 3 Jan 2005 14:37:27 +0000 (+0000) Subject: Support '-1' as a special value in memory limit for max attachment filesize. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4f21ba00a032d9ab17337ab91aa7426480986bd9;p=squirrelmail.git Support '-1' as a special value in memory limit for max attachment filesize. #1094569 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8564 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index 4467a02d..927054ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -173,6 +173,8 @@ Version 1.5.1 -- CVS Fixes #983614. - Fix listcommands plugin to behave like normal reply/compose links, and return to message page that originally called from. + - Max upload file size now correctly handles a '-1' value, meaning + unlimited (#1094569). Version 1.5.0 -------------------- diff --git a/src/compose.php b/src/compose.php index f0213271..890890a1 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1098,19 +1098,21 @@ function showInputForm ($session, $values=false) { /* php.ini vars which influence the max for uploads */ $configvars = array('post_max_size', 'memory_limit', 'upload_max_filesize'); foreach($configvars as $var) { - /* skip 0 or empty values */ + /* skip 0 or empty values, and -1 which means 'unlimited' */ if( $size = getByteSize(ini_get($var)) ) { - $sizes[] = $size; + if ( $size != '-1' ) { + $sizes[] = $size; + } } } if(count($sizes) > 0) { $maxsize = '(max. ' . show_readable_size( min( $sizes ) ) . ')'; + echo addHidden('MAX_FILE_SIZE', min( $sizes )); } else { $maxsize = ''; } - echo addHidden('MAX_FILE_SIZE', min( $sizes )). - ' ' . "\n" . + echo ' ' . "\n" . ' ' . "\n" . ' ' . "\n" .