[Pkg-owncloud-commits] [owncloud] 45/104: Added workaround for Android content disposition
David Prévot
taffit at moszumanska.debian.org
Sat Jan 18 13:33:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit b7aaebf94f4c12b19ab4795bf70936eee252678b
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Tue Dec 10 12:40:59 2013 +0100
Added workaround for Android content disposition
Fixes #5807
---
lib/private/response.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/private/response.php b/lib/private/response.php
index 1b9cb47..c6edda0 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 )
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list