mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge pull request #5274 from rubencm/ticket/14285
[ticket/14285] Move downloads to controller
This commit is contained in:
@@ -817,7 +817,7 @@ function posting_gen_inline_attachments(&$attachment_data)
|
||||
*/
|
||||
function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true)
|
||||
{
|
||||
global $template, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher;
|
||||
global $template, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher, $phpbb_container;
|
||||
|
||||
// Some default template variables
|
||||
$template->assign_vars(array(
|
||||
@@ -845,7 +845,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
|
||||
$hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />';
|
||||
}
|
||||
|
||||
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false);
|
||||
$download_link = $phpbb_container->get('controller.helper')->route('phpbb_storage_attachment', ['file' => (int) $attach_row['attach_id']]);
|
||||
|
||||
$attachrow_template_vars[(int) $attach_row['attach_id']] = array(
|
||||
'FILENAME' => utf8_basename($attach_row['real_filename']),
|
||||
|
Reference in New Issue
Block a user