From 0b8944c28d40272b9a20e29f1f2cb51720648138 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 10 May 2005 17:00:41 +0000 Subject: [PATCH] - check for empty uploaded file git-svn-id: file:///svn/phpbb/trunk@5147 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_upload.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 28041c87fa..774b359dee 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -374,6 +374,7 @@ class fileupload return $file; } + // Error array filled? if (isset($_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 if ($file->get('filename') == 'none') {