diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-12-28 22:23:52 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-12-28 22:23:52 +0100 |
commit | 442d21ace2b5d33e328917d7e7ac536709ba4d5c (patch) | |
tree | 635d625dffc95155ede879b3fefa6a480e22b446 /phpBB/includes/functions_download.php | |
parent | c431dc0d04f602a31fda6d861c096cfa480275f4 (diff) | |
parent | 3ccaac488b77c2eb89a9db9ec025bfd2d14fa648 (diff) | |
download | forums-442d21ace2b5d33e328917d7e7ac536709ba4d5c.tar forums-442d21ace2b5d33e328917d7e7ac536709ba4d5c.tar.gz forums-442d21ace2b5d33e328917d7e7ac536709ba4d5c.tar.bz2 forums-442d21ace2b5d33e328917d7e7ac536709ba4d5c.tar.xz forums-442d21ace2b5d33e328917d7e7ac536709ba4d5c.zip |
Merge branch '3.1.x' into 3.2.x
Diffstat (limited to 'phpBB/includes/functions_download.php')
-rw-r--r-- | phpBB/includes/functions_download.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index d68709f2f8..e00be1e01a 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -124,7 +124,7 @@ function wrap_img_in_html($src, $title) */ function send_file_to_browser($attachment, $upload_dir, $category) { - global $user, $db, $phpbb_root_path, $request; + global $user, $db, $phpbb_dispatcher, $phpbb_root_path, $request; $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename']; @@ -149,6 +149,26 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Now send the File Contents to the Browser $size = @filesize($filename); + /** + * Event to alter attachment before it is sent to browser. + * + * @event core.send_file_to_browser_before + * @var array attachment Attachment data + * @var string upload_dir Relative path of upload directory + * @var int category Attachment category + * @var string filename Path to file, including filename + * @var int size File size + * @since 3.1.11-RC1 + */ + $vars = array( + 'attachment', + 'upload_dir', + 'category', + 'filename', + 'size', + ); + extract($phpbb_dispatcher->trigger_event('core.send_file_to_browser_before', compact($vars))); + // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work) // Check if headers already sent or not able to get the file contents. |