From ce48b4de57e55ebdb6ee4bbc2eac2f81998cc671 Mon Sep 17 00:00:00 2001 From: Dan Villiom Podlaski Christiansen Date: Wed, 7 Sep 2016 03:17:44 +0200 Subject: [ticket/12133] fix download file names for WebKit-derived browsers All browser engines that descend from WebKit declare themselves as Safari in the user agent, including Chrome. Currently, the code assumes that any Safari-like browser cannot handle the RFC-compliant filename syntax. At least for recent versions of Safari, this is no longer the case, and the legacy syntax results in URI-quoted filenames. Using the standard syntax works as expected in both Safari 9 and Chrome 45. The ticket reporting this issue is from January 2014, so we can safely ignore compatibility: any browser still relying on the previous behaviour is unlikely to receive security updates. PHPBB3-12133 --- phpBB/includes/functions_download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_download.php') diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 2c6f62227c..c571de579e 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -284,7 +284,7 @@ function header_filename($file) // There be dragons here. // Not many follows the RFC... - if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Safari') !== false || strpos($user_agent, 'Konqueror') !== false) + if (strpos($user_agent, 'MSIE') !== false || strpos($user_agent, 'Konqueror') !== false) { return "filename=" . rawurlencode($file); } -- cgit v1.2.1