mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-13 20:32:11 +02:00
[ticket/15663] Remove flash attachments support
PHPBB3-15663
This commit is contained in:
parent
9e3141d9d3
commit
65b0698ef7
@ -257,11 +257,6 @@ else
|
||||
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||
}
|
||||
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_FLASH && !$user->optionget('viewflash'))
|
||||
{
|
||||
$display_cat = ATTACHMENT_CATEGORY_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Event to modify data before sending file to browser
|
||||
*
|
||||
|
@ -606,7 +606,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);
|
||||
@ -1385,7 +1384,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)
|
||||
|
@ -1245,11 +1245,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';
|
||||
|
||||
@ -1281,21 +1276,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:
|
||||
list($width, $height) = @getimagesize($filename);
|
||||
|
||||
$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';
|
||||
|
||||
|
@ -206,28 +206,20 @@ function send_file_to_browser($attachment, $upload_dir, $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');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1399,10 +1399,6 @@ function phpbb_attachment_category($cat_id)
|
||||
case 2:
|
||||
return ATTACHMENT_CATEGORY_WM;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
return ATTACHMENT_CATEGORY_FLASH;
|
||||
break;
|
||||
}
|
||||
|
||||
return ATTACHMENT_CATEGORY_NONE;
|
||||
|
@ -68,7 +68,6 @@ $lang = array_merge($lang, array(
|
||||
'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.',
|
||||
'ATTACH_TO_POST' => 'Attach file to post',
|
||||
|
||||
'CAT_FLASH_FILES' => 'Flash files',
|
||||
'CAT_IMAGES' => 'Images',
|
||||
'CHECK_CONTENT' => 'Check attachment files',
|
||||
'CHECK_CONTENT_EXPLAIN' => 'Some browsers can be tricked to assume an incorrect mimetype for uploaded files. This option ensures that such files likely to cause this are rejected.',
|
||||
@ -99,7 +98,6 @@ $lang = array_merge($lang, array(
|
||||
'EXT_GROUP_ARCHIVES' => 'Archives',
|
||||
'EXT_GROUP_DOCUMENTS' => 'Documents',
|
||||
'EXT_GROUP_DOWNLOADABLE_FILES' => 'Downloadable Files',
|
||||
'EXT_GROUP_FLASH_FILES' => 'Flash Files',
|
||||
'EXT_GROUP_IMAGES' => 'Images',
|
||||
'EXT_GROUP_PLAIN_TEXT' => 'Plain Text',
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user