"small change on the upload to be still able to detect failed uploads caused by to small upload_max_filesize

--> !empty($file['name]) && empty($file['tmp_name'])"
This commit is contained in:
Ralf Becker 2009-02-26 14:42:50 +00:00
parent a5a28ad708
commit 8abb78f918

View File

@ -2102,10 +2102,10 @@ class etemplate extends boetemplate
$file[$part] = $this->get_array($_FILES[$name],$part.$index.($multiple ? "[$i]" : ''));
}
if (!$multiple) $file['path'] = $this->get_array($content_in,substr($form_name,0,-1).'_path]');
$file['ip'] = get_var('REMOTE_ADDR',Array('SERVER'));
if ((string)$file['tmp_name'] === '' || function_exists('is_uploaded_file') && !is_uploaded_file($file['tmp_name']))
$file['ip'] = $_SERVER['REMOTE_ADDR'];
if ((string)$file['name'] === '' || $file['tmp_name'] && function_exists('is_uploaded_file') && !is_uploaded_file($file['tmp_name']))
{
if ($multiple && ($file['tmp_name'] === '' || $file['error']))
if ($multiple && ($file['name'] === '' || $file['error']))
{
continue; // ignore empty upload box
}