Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/14101] Add core event to the download/file.php #3831

Merged
merged 1 commit into from Aug 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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