1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/15663] Remove flash attachments support

PHPBB3-15663
This commit is contained in:
Rubén Calvo
2018-05-08 14:30:32 +02:00
parent 5087d5d6b6
commit 3966440008
6 changed files with 9 additions and 61 deletions

View File

@@ -630,7 +630,6 @@ class acp_attachments
$cat_lang = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
);
$group_id = $request->variable('g', 0);
@@ -1409,7 +1408,6 @@ class acp_attachments
$types = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
);
if ($group_id)

View File

@@ -1247,11 +1247,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$display_cat = ATTACHMENT_CATEGORY_NONE;
}
if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
{
$display_cat = ATTACHMENT_CATEGORY_NONE;
}
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
$l_downloaded_viewed = 'VIEWED_COUNTS';
@@ -1283,32 +1278,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$update_count_ary[] = $attachment['attach_id'];
break;
// Macromedia Flash Files
case ATTACHMENT_CATEGORY_FLASH:
try
{
$file_info = $storage_attachment->file_info($filename);
$width = $file_info->image_width;
$height = $file_info->image_height;
}
catch (\Exception $e)
{
$width = 0;
$height = 0;
}
$block_array += array(
'S_FLASH_FILE' => true,
'WIDTH' => $width,
'HEIGHT' => $height,
'U_VIEW_LINK' => $download_link . '&view=1',
);
// Viewed/Heared File ... update the download count
$update_count_ary[] = $attachment['attach_id'];
break;
default:
$l_downloaded_viewed = 'DOWNLOAD_COUNTS';

View File

@@ -206,28 +206,20 @@ function send_file_to_browser($attachment, $category)
header('X-Content-Type-Options: nosniff');
}
if ($category == ATTACHMENT_CATEGORY_FLASH && $request->variable('view', 0) === 1)
if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
{
// We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
header('Content-Disposition: inline');
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
{
header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
}
}
else
{
if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
{
header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
}
}
else
{
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('X-Download-Options: noopen');
}
header('X-Download-Options: noopen');
}
}