1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-03 15:27:42 +02:00

[ticket/15687] Add attachment filename to attachment URL

This will also fix the invalid requirements for the file parameter of the URL.

PHPBB3-15687
This commit is contained in:
Marc Alexander
2023-06-27 21:00:16 +02:00
parent d73b60781e
commit df6ab1a811
7 changed files with 68 additions and 11 deletions

View File

@@ -1285,14 +1285,26 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$display_cat = attachment_category::NONE;
}
$download_link = $controller_helper->route('phpbb_storage_attachment', ['file' => (int) $attachment['attach_id']]);
$download_link = $controller_helper->route(
'phpbb_storage_attachment',
[
'file' => (int) $attachment['attach_id'],
'filename' => $attachment['real_filename'],
]
);
$l_downloaded_viewed = 'VIEWED_COUNTS';
switch ($display_cat)
{
// Images
case attachment_category::IMAGE:
$inline_link = $controller_helper->route('phpbb_storage_attachment', ['file' => (int) $attachment['attach_id']]);
$inline_link = $controller_helper->route(
'phpbb_storage_attachment',
[
'file' => (int) $attachment['attach_id'],
'filename' => $attachment['real_filename'],
]
);
$block_array += array(
'S_IMAGE' => true,
@@ -1304,7 +1316,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
// Images, but display Thumbnail
case attachment_category::THUMB:
$thumbnail_link = $controller_helper->route('phpbb_storage_attachment', ['file' => (int) $attachment['attach_id'], 't' => 1]);
$thumbnail_link = $controller_helper->route(
'phpbb_storage_attachment',
[
'file' => (int) $attachment['attach_id'],
'filename' => $attachment['real_filename'],
't' => 1,
]
);
$block_array += array(
'S_THUMBNAIL' => true,