From 4f21ba00a032d9ab17337ab91aa7426480986bd9 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 3 Jan 2005 14:37:27 +0000 Subject: [PATCH] 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 --- ChangeLog | 2 ++ src/compose.php | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) 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" . -- 2.25.1