diff options
author | erangamapa <erangamapa@gmail.com> | 2013-05-25 10:50:43 +0530 |
---|---|---|
committer | erangamapa <erangamapa@gmail.com> | 2013-05-25 10:50:43 +0530 |
commit | 8191755cca418ad2124e11e4e93559b9cad7d8bd (patch) | |
tree | ac3344e2c8f2e104061b94eb753ec9d6690fc841 /phpBB/includes/functions_posting.php | |
parent | 996f1abee3640848dbcb00062646b681fe5e58af (diff) | |
download | forums-8191755cca418ad2124e11e4e93559b9cad7d8bd.tar forums-8191755cca418ad2124e11e4e93559b9cad7d8bd.tar.gz forums-8191755cca418ad2124e11e4e93559b9cad7d8bd.tar.bz2 forums-8191755cca418ad2124e11e4e93559b9cad7d8bd.tar.xz forums-8191755cca418ad2124e11e4e93559b9cad7d8bd.zip |
[ticket/11145] Wrong error thrown when uploading a bigger image.
When attaching an image to a post with a size larger than maximum defined in
php.ini, 'ATTACHED_IMAGE_NOT_IMAGE' error is thrown. $file->is_image() is
returning false value when image size is too large. Therefore, moved
not image test down after image size test.
PHPBB3-11145
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 e5cbae0d71..2e5130c5b8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -423,16 +423,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; @@ -473,6 +463,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'); |