1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

Merge pull request #5274 from rubencm/ticket/14285

[ticket/14285] Move downloads to controller
This commit is contained in:
Marc Alexander
2021-05-28 07:17:15 +02:00
committed by GitHub
26 changed files with 1037 additions and 1335 deletions

View File

@@ -14,6 +14,9 @@
/**
* @ignore
*/
use phpbb\controller\helper;
if (!defined('IN_PHPBB'))
{
exit;
@@ -31,6 +34,9 @@ class ucp_attachments
{
global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container, $request, $auth;
/** @var helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
$start = $request->variable('start', 0);
$sort_key = $request->variable('sk', 'a');
$sort_dir = $request->variable('sd', 'a');
@@ -179,7 +185,7 @@ class ucp_attachments
'S_IN_MESSAGE' => $row['in_message'],
'S_LOCKED' => !$row['in_message'] && !$auth->acl_get('m_edit', $row['forum_id']) && ($row['forum_status'] == ITEM_LOCKED || $row['topic_status'] == ITEM_LOCKED || $row['post_edit_locked']),
'U_VIEW_ATTACHMENT' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $row['attach_id']),
'U_VIEW_ATTACHMENT' => $controller_helper->route('phpbb_storage_attachment', ['file' => (int) $row['attach_id']]),
'U_VIEW_TOPIC' => $view_topic)
);