summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-10 12:05:39 +0100
committerVincent Petry <pvince81@owncloud.com>2013-12-10 12:42:26 +0100
commit409b5108896edda9adf916cd566dbce2d2b00351 (patch)
treeaaa25fd8a1ae7365a6df19df60b4f27f4086df4c /apps/files_versions
parentbc3650e48c7ec4f05794c2bd98a90cca3090f1e3 (diff)
downloadnextcloud-server-409b5108896edda9adf916cd566dbce2d2b00351.tar.gz
nextcloud-server-409b5108896edda9adf916cd566dbce2d2b00351.zip
Moved content disposition code+workarounds to OCP\Response
Added new OC\Response API called setContentDispositionHeader() that contains the needed workarounds for UTF8 and IE. Refactored download code to use the new API. Removed unused trashbin download file.
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/download.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php
index 040a662e61b..2fe56d2e638 100644
--- a/apps/files_versions/download.php
+++ b/apps/files_versions/download.php
@@ -36,12 +36,7 @@ $view = new OC\Files\View('/');
$ftype = $view->getMimeType('/'.$uid.'/files/'.$filename);
header('Content-Type:'.$ftype);
-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) ) . '"' );
-}
+OCP\Response::setContentDispositionHeader(basename($filename), 'attachment');
OCP\Response::disableCaching();
header('Content-Length: '.$view->filesize($versionName));