parent
409b510889
commit
82bf1f9c8c
|
@ -153,7 +153,8 @@ class OC_Response {
|
||||||
* @param string $type disposition type, either 'attachment' or 'inline'
|
* @param string $type disposition type, either 'attachment' or 'inline'
|
||||||
*/
|
*/
|
||||||
static public function setContentDispositionHeader( $filename, $type = 'attachment' ) {
|
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 ) . '"' );
|
header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' );
|
||||||
} else {
|
} else {
|
||||||
header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename )
|
header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename )
|
||||||
|
|
Loading…
Reference in New Issue