aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-03-17 14:42:13 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-03-17 14:42:13 +0000
commitd4ac2d4209505075fefaa76a5be227d6a413c2ec (patch)
tree10e7508ccc95a6e95dc550447dadf7c6f9ffab8d /phpBB/download
parent8dfc457858943734f33fd2fb51b492c07b41a4fd (diff)
downloadforums-d4ac2d4209505075fefaa76a5be227d6a413c2ec.tar
forums-d4ac2d4209505075fefaa76a5be227d6a413c2ec.tar.gz
forums-d4ac2d4209505075fefaa76a5be227d6a413c2ec.tar.bz2
forums-d4ac2d4209505075fefaa76a5be227d6a413c2ec.tar.xz
forums-d4ac2d4209505075fefaa76a5be227d6a413c2ec.zip
Flash files do not display anymore after update to flash player 10 (Bug #41315)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9384 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/download')
-rw-r--r--phpBB/download/file.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 309a136e3a..f71afb670e 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -465,24 +465,34 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
$is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
header('Content-Type: ' . $attachment['mimetype']);
+
if ($is_ie8)
{
header('X-Content-Type-Options: nosniff');
}
- if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
+
+ if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
{
- 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: -1');
- }
+ // 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');
}
else
{
- header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
+ if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
{
- header('X-Download-Options: noopen');
+ 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: -1');
+ }
+ }
+ else
+ {
+ header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
+ if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
+ {
+ header('X-Download-Options: noopen');
+ }
}
}