From 469f139a2fc4835478ddb32cf329ad8f4d6ca3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Wed, 11 Jul 2018 09:16:49 +0200 Subject: [PATCH] [ticket/14285] Move code to increment download count PHPBB3-14285 --- phpBB/phpbb/storage/controller/attachment.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/phpBB/phpbb/storage/controller/attachment.php b/phpBB/phpbb/storage/controller/attachment.php index e86f233b97..8c30cae1fa 100644 --- a/phpBB/phpbb/storage/controller/attachment.php +++ b/phpBB/phpbb/storage/controller/attachment.php @@ -151,19 +151,17 @@ class attachment extends controller $display_cat = $extensions[$attachment['extension']]['display_cat']; - if (($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$this->user->optionget('viewimg')) - { - $display_cat = ATTACHMENT_CATEGORY_NONE; - } - if ($thumbnail) { $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; } else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan']) { - // Update download count - $this->phpbb_increment_downloads($attachment['attach_id']); + if (!(($display_cat == ATTACHMENT_CATEGORY_IMAGE || $display_cat == ATTACHMENT_CATEGORY_THUMB) && !$this->user->optionget('viewimg'))) + { + // Update download count + $this->phpbb_increment_downloads($attachment['attach_id']); + } } $redirect = '';