#33885 [Opn->Bgs]: HTML_Quickform maximum upload filesize should follow php.ini
| From: | tony2001@php.net | Date: | Wed, 27 Jul 2005 13:43:06 +0000 |
| Subject: | #33885 [Opn->Bgs]: HTML_Quickform maximum upload filesize should follow php.ini | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82530@lists.php.net to get a copy of this message | ||
ID: 33885
Updated by: tony2001@php.net
Reported By: weseman at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: OpenBSD
PHP Version: 4.3.11
New Comment:
Please report PEAR issues into the PEAR bug system:
http://pear.php.net/bugs/
Previous Comments:
------------------------------------------------------------------------
[2005-07-27 15:38:18] weseman at gmail dot com
Description:
------------
HTML_Quickform uses a default maximum upload filesize of 1megabyte,
which is set through the private property _maxFileSize. IMO, it would
be better to follow the filesize specified by php.ini, as this is the
value that finally decides what size an upload can be.
Reproduce code:
---------------
Place this in the constructor:
if (preg_match('/^([0-9]+)([a-zA-Z]*)$/',
ini_get('upload_max_filesize'), $matches)) {
// according to:
//
http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
// valid values are G, M or K, or no multiplier at all.
switch (strtoupper($matches['2'])) {
case 'G':
$this->_maxFileSize = $matches['1'] * 1073741824;
break;
case 'M':
$this->_maxFileSize = $matches['1'] * 1048576;
break;
case 'K':
$this->_maxFileSize = $matches['1'] * 1024;
break;
default:
$this->_maxFileSize = $matches['1'];
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33885&edit=1