summaryrefslogtreecommitdiffstats
path: root/lib/private/response.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-10 12:40:59 +0100
committerVincent Petry <pvince81@owncloud.com>2013-12-10 12:42:41 +0100
commit82bf1f9c8ccbfed39790d22b2fbea2c5286122dc (patch)
tree6de550d3b67a9f444ef050b80b791ca61dd1f8cc /lib/private/response.php
parent409b5108896edda9adf916cd566dbce2d2b00351 (diff)
downloadnextcloud-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.php3
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 )