mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- check for empty uploaded file
git-svn-id: file:///svn/phpbb/trunk@5147 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5b650f2c52
commit
0b8944c28d
1 changed files with 8 additions and 0 deletions
|
@ -374,6 +374,7 @@ class fileupload
|
||||||
return $file;
|
return $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Error array filled?
|
||||||
if (isset($_FILES[$form_name]['error']))
|
if (isset($_FILES[$form_name]['error']))
|
||||||
{
|
{
|
||||||
$error = $this->assign_internal_error($_FILES[$form_name]['error']);
|
$error = $this->assign_internal_error($_FILES[$form_name]['error']);
|
||||||
|
@ -385,6 +386,13 @@ class fileupload
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if empty file got uploaded (not catched by is_uploaded_file)
|
||||||
|
if (isset($_FILES[$form_name]['size']) && $_FILES[$form_name]['size'] == 0)
|
||||||
|
{
|
||||||
|
$file->error[] = $user->lang[$this->error_prefix . 'EMPTY_FILEUPLOAD'];
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
|
||||||
// PHP Upload filesize exceeded
|
// PHP Upload filesize exceeded
|
||||||
if ($file->get('filename') == 'none')
|
if ($file->get('filename') == 'none')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue