[ticket/15688] Fix event location in attachments download

PHPBB3-15688
This commit is contained in:
Rubén Calvo 2018-06-09 17:09:33 +02:00
parent d1dd9d383e
commit 8896018e66

View file

@ -266,6 +266,16 @@ else
$display_cat = ATTACHMENT_CATEGORY_NONE; $display_cat = ATTACHMENT_CATEGORY_NONE;
} }
if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize']))
{
// Update download count
phpbb_increment_downloads($db, $attachment['attach_id']);
}
$redirect = ''; $redirect = '';
/** /**
@ -294,16 +304,6 @@ else
); );
extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars))); extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars)));
if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
}
else if ($display_cat == ATTACHMENT_CATEGORY_NONE && !$attachment['is_orphan'] && !phpbb_http_byte_range($attachment['filesize']))
{
// Update download count
phpbb_increment_downloads($db, $attachment['attach_id']);
}
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)) if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && (strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7))
{ {
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']); wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);