Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-12-17 19:23:12 +0400
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-12-17 19:46:07 +0400
commitb6eb95349e6e339c90f8165bcd0471bd6268f8c3 (patch)
tree2a3e7c235a7fe8baca9598d306246a93b51777b7 /lib/files.php
parent6861d4271508e96a27c4e9e2e7954ef90cfa8034 (diff)
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/files.php')
-rw-r--r--lib/files.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php
index 152ed8f34a7..f8bae778ed2 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -197,7 +197,12 @@ class OC_Files {
}
OC_Util::obEnd();
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) {