diff --git a/phpBB/download/file.php b/phpBB/download/file.php index dd9df06f08..e0e55a5b95 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -266,6 +266,8 @@ else $display_cat = ATTACHMENT_CATEGORY_NONE; } + $redirect = ''; + /** * Event to modify data before sending file to browser * @@ -278,6 +280,7 @@ else * @var bool thumbnail Flag indicating if the file is a thumbnail * @since 3.1.6-RC1 * @changed 3.1.7-RC1 Fixing wrong name of a variable (replacing "extension" by "extensions") + * @changed 3.3.0-a1 Add redirect variable */ $vars = array( 'attach_id', @@ -286,6 +289,7 @@ else 'extensions', 'mode', 'thumbnail', + 'redirect', ); extract($phpbb_dispatcher->trigger_event('core.download_file_send_to_browser_before', compact($vars))); @@ -306,7 +310,14 @@ else } else { - send_file_to_browser($attachment, $display_cat); + if (!empty($redirect)) + { + redirect($redirect, false, true); + } + else { + send_file_to_browser($attachment, $display_cat); + } + file_gc(); } }