diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-12-10 12:40:59 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-12-10 12:42:41 +0100 |
commit | 82bf1f9c8ccbfed39790d22b2fbea2c5286122dc (patch) | |
tree | 6de550d3b67a9f444ef050b80b791ca61dd1f8cc /lib/private/response.php | |
parent | 409b5108896edda9adf916cd566dbce2d2b00351 (diff) | |
download | nextcloud-server-82bf1f9c8ccbfed39790d22b2fbea2c5286122dc.tar.gz nextcloud-server-82bf1f9c8ccbfed39790d22b2fbea2c5286122dc.zip |
Added workaround for Android content disposition
Fixes #5807
Diffstat (limited to 'lib/private/response.php')
-rw-r--r-- | lib/private/response.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/response.php b/lib/private/response.php index 1b9cb473d67..c6edda0f949 100644 --- a/lib/private/response.php +++ b/lib/private/response.php @@ -153,7 +153,8 @@ class OC_Response { * @param string $type disposition type, either 'attachment' or 'inline' */ static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { - if ( preg_match( "/MSIE/", $_SERVER["HTTP_USER_AGENT"] ) ) { + // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent + if ( preg_match( '/MSIE/', $_SERVER['HTTP_USER_AGENT'] ) or preg_match( '#Android.*Chrome/[.0-9]*#', $_SERVER['HTTP_USER_AGENT'] ) ) { header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' ); } else { header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename ) |