diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-06-03 15:58:32 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-06-03 15:58:32 +0200 |
commit | 99d089ce9fec415b4054aec8ea4c1032080eb6a0 (patch) | |
tree | cef4b15f6862f39638ccdea228abb7fd463eab07 /phpBB/includes/functions_posting.php | |
parent | a20a0e06c2baecae807647cf953f920e3952b0e5 (diff) | |
parent | a3d15938047fb02a12276805427682beb36e5184 (diff) | |
download | forums-99d089ce9fec415b4054aec8ea4c1032080eb6a0.tar forums-99d089ce9fec415b4054aec8ea4c1032080eb6a0.tar.gz forums-99d089ce9fec415b4054aec8ea4c1032080eb6a0.tar.bz2 forums-99d089ce9fec415b4054aec8ea4c1032080eb6a0.tar.xz forums-99d089ce9fec415b4054aec8ea4c1032080eb6a0.zip |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/11145] Wrong error thrown when uploading a bigger image.
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index baef7bcda5..e823f8be75 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -431,16 +431,6 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $cat_id = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] : ATTACHMENT_CATEGORY_NONE; - // Make sure the image category only holds valid images... - if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image()) - { - $file->remove(); - - // If this error occurs a user tried to exploit an IE Bug by renaming extensions - // Since the image category is displaying content inline we need to catch this. - trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']); - } - // Do we have to create a thumbnail? $filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0; @@ -481,6 +471,16 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage return $filedata; } + // Make sure the image category only holds valid images... + if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image()) + { + $file->remove(); + + // If this error occurs a user tried to exploit an IE Bug by renaming extensions + // Since the image category is displaying content inline we need to catch this. + trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']); + } + $filedata['filesize'] = $file->get('filesize'); $filedata['mimetype'] = $file->get('mimetype'); $filedata['extension'] = $file->get('extension'); |