Skip to content

Commit

Permalink
Merge pull request phpbb#3831 from rxu/ticket/14101
Browse files Browse the repository at this point in the history
[ticket/14101] Add core event to the download/file.php
  • Loading branch information
marc1706 committed Aug 22, 2015
2 parents b09e1ad + e22dbbc commit f2a0fe3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions phpBB/download/file.php
Expand Up @@ -250,6 +250,30 @@
$display_cat = ATTACHMENT_CATEGORY_NONE;
}

/**
* Event to modify data before sending file to browser
*
* @event core.download_file_send_to_browser_before
* @var int attach_id The attachment ID
* @var array attachment Array with attachment data
* @var int display_cat Attachment category
* @var int download_mode File extension specific download mode
* @var array extension Array with file extensions data
* @var string mode Download mode
* @var bool thumbnail Flag indicating if the file is a thumbnail
* @since 3.1.6-RC1
*/
$vars = array(
'attach_id',
'attachment',
'display_cat',
'download_mode',
'extension',
'mode',
'thumbnail',
);
extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars)));

if ($thumbnail)
{
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
Expand Down

0 comments on commit f2a0fe3

Please sign in to comment.