Skip to content

Commit

Permalink
Merge pull request phpbb#5242 from rubencm/ticket/15688
Browse files Browse the repository at this point in the history
[ticket/15688] Fix event location in attachments download
  • Loading branch information
marc1706 authored Jun 29, 2018
2 parents 7266e69 + 8896018 commit 1491ce8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions phpBB/download/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,16 @@
$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 = '';

/**
Expand Down Expand Up @@ -294,16 +304,6 @@
);
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))
{
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
Expand Down

0 comments on commit 1491ce8

Please sign in to comment.