|
|
@@ -589,17 +589,12 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
{
|
|
|
if (self::$_maxFileSize < 0) {
|
|
|
$ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
|
|
|
- $mem = $this->_convertIniToInteger(trim(ini_get('memory_limit')));
|
|
|
$max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
|
|
|
- $min = max($ini, $mem, $max);
|
|
|
+ $min = max($ini, $max);
|
|
|
if ($ini > 0) {
|
|
|
$min = min($min, $ini);
|
|
|
}
|
|
|
|
|
|
- if ($mem > 0) {
|
|
|
- $min = min($min, $mem);
|
|
|
- }
|
|
|
-
|
|
|
if ($max > 0) {
|
|
|
$min = min($min, $max);
|
|
|
}
|
|
|
@@ -619,24 +614,18 @@ class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
|
|
|
public function setMaxFileSize($size)
|
|
|
{
|
|
|
$ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
|
|
|
- $mem = $this->_convertIniToInteger(trim(ini_get('memory_limit')));
|
|
|
$max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
|
|
|
|
|
|
if (($max > -1) && ($size > $max)) {
|
|
|
- trigger_error("Your 'upload_max_filesize' config setting allows only $max. You set $size.", E_USER_NOTICE);
|
|
|
+ trigger_error("Your 'upload_max_filesize' config setting limits the maximum filesize to '$max'. You tried to set '$size'.", E_USER_NOTICE);
|
|
|
$size = $max;
|
|
|
}
|
|
|
|
|
|
if (($ini > -1) && ($size > $ini)) {
|
|
|
- trigger_error("Your 'post_max_size' config setting allows only $ini. You set $size.", E_USER_NOTICE);
|
|
|
+ trigger_error("Your 'post_max_size' config setting limits the maximum filesize to '$ini'. You tried to set '$size'.", E_USER_NOTICE);
|
|
|
$size = $ini;
|
|
|
}
|
|
|
|
|
|
- if (($mem > -1) && ($size > $mem)) {
|
|
|
- trigger_error("Your 'memory_limit' config setting allows only $mem. You set $size.", E_USER_NOTICE);
|
|
|
- $size = $mem;
|
|
|
- }
|
|
|
-
|
|
|
self::$_maxFileSize = $size;
|
|
|
return $this;
|
|
|
}
|