diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/files.php b/lib/private/files.php index 6a6916537d4..656d6f044ca 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -106,7 +106,12 @@ class OC_Files { if ($xsendfile) { $filename = OC_Helper::moveToNoClean($filename); } - $name = $files . '.zip'; + // downloading root ? + if ($files === '') { + $name = 'download.zip'; + } else { + $name = $files . '.zip'; + } set_time_limit($executionTime); } else { $zip = false; @@ -208,6 +213,8 @@ class OC_Files { $dirname=basename($dir); $zip->addEmptyDir($internalDir.$dirname); $internalDir.=$dirname.='/'; + // prevent absolute dirs + $internalDir = ltrim($internalDir, '/'); $files=OC_Files::getDirectoryContent($dir); foreach($files as $file) { $filename=$file['name']; |