From 0b136a623174531830da9687444ed2d7c760ff7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 30 Jun 2018 04:04:19 +0200 Subject: [PATCH] [ticket/14285] Remove support for old browsers PHPBB3-14285 --- phpBB/includes/functions_download.php | 20 ------------------- phpBB/phpbb/storage/controller/attachment.php | 2 +- phpBB/phpbb/storage/controller/avatar.php | 2 +- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 6ec95e966e..37da8e8887 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -43,26 +43,6 @@ function wrap_img_in_html($src, $title) echo ''; } -/** -* Get a browser friendly UTF-8 encoded filename -*/ -function header_filename($file) -{ - global $request; - - $user_agent = $request->header('User-Agent'); - - // There be dragons here. - // Not many follows the RFC... - if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Konqueror') !== false) - { - return "filename=" . rawurlencode($file); - } - - // follow the RFC for extended filename for the rest - return "filename*=UTF-8''" . rawurlencode($file); -} - /** * Garbage Collection * diff --git a/phpBB/phpbb/storage/controller/attachment.php b/phpBB/phpbb/storage/controller/attachment.php index 24f638289b..2535bcf4f6 100644 --- a/phpBB/phpbb/storage/controller/attachment.php +++ b/phpBB/phpbb/storage/controller/attachment.php @@ -313,7 +313,7 @@ class attachment extends controller } else { - header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); + header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . "; filename*=UTF-8''" . rawurlencode(htmlspecialchars_decode($attachment['real_filename']))); if (strpos($attachment['mimetype'], 'image') !== 0) { diff --git a/phpBB/phpbb/storage/controller/avatar.php b/phpBB/phpbb/storage/controller/avatar.php index f1344137e7..6dc177cf06 100644 --- a/phpBB/phpbb/storage/controller/avatar.php +++ b/phpBB/phpbb/storage/controller/avatar.php @@ -66,7 +66,7 @@ class avatar extends controller { if (!headers_sent()) { - header('Content-Disposition: inline; ' . header_filename($file)); + header("Content-Disposition: inline; filename*=UTF-8''" . rawurlencode($file)); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600*24*365) . ' GMT'); }