summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-12-17 16:23:12 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-12-17 16:44:23 +0100
commite02e218a5aac3b17c41b1820139dcf6efd03e44e (patch)
tree8be365a126238a6cf95d51bcea4743b2791649c2 /lib
parent94db6c64a9d79e1cade6d0aae1602852be39b41c (diff)
downloadnextcloud-server-e02e218a5aac3b17c41b1820139dcf6efd03e44e.tar.gz
nextcloud-server-e02e218a5aac3b17c41b1820139dcf6efd03e44e.zip
fix utf8 filenames in ie download response header according to rfc5987, see http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http
Diffstat (limited to 'lib')
-rw-r--r--lib/files.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php
index d96e9dfabc4..a4dbddc3ea6 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -184,7 +184,12 @@ class OC_Files {
}
@ob_end_clean();
if($zip or OC_Filesystem::is_readable($filename)) {
- header('Content-Disposition: attachment; filename="'.basename($filename).'"');
+ if ( preg_match( "/MSIE/", $_SERVER["HTTP_USER_AGENT"] ) ) {
+ header( 'Content-Disposition: attachment; filename="' . rawurlencode( basename($filename) ) . '"' );
+ } else {
+ header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode( basename($filename) )
+ . '; filename="' . rawurlencode( basename($filename) ) . '"' );
+ }
header('Content-Transfer-Encoding: binary');
OC_Response::disableCaching();
if($zip) {