summaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/files.php b/lib/files.php
index 04ba51d9d24..ab7fa1ed096 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -59,11 +59,7 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- if ($xsendfile) {
- $filename = OC_Helper::tmpFileNoClean('.zip');
- }else{
- $filename = OC_Helper::tmpFile('.zip');
- }
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
@@ -78,6 +74,9 @@ class OC_Files {
}
}
$zip->close();
+ if ($xsendfile) {
+ $filename = OC_Helper::moveToNoClean($filename);
+ }
$basename = basename($dir);
if ($basename) {
$name = $basename . '.zip';
@@ -91,17 +90,16 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- if ($xsendfile) {
- $filename = OC_Helper::tmpFileNoClean('.zip');
- }else{
- $filename = OC_Helper::tmpFile('.zip');
- }
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==true) {
exit("cannot open <$filename>\n");
}
$file = $dir . '/' . $files;
self::zipAddDir($file, $zip);
$zip->close();
+ if ($xsendfile) {
+ $filename = OC_Helper::moveToNoClean($filename);
+ }
$name = $files . '.zip';
set_time_limit($executionTime);
} else {