diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-20 10:51:13 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-20 10:51:13 +0100 |
commit | 3e235b2699037e1ed3c43e848e2c0e2334b232d8 (patch) | |
tree | 818dac88fb9ffb274f16c6d0e0424eda64d9d243 /lib | |
parent | a6fb6abbe015b6c2fa643da94884fc1ec2fdb336 (diff) | |
parent | 3bd984ebf08f2a5c1342e799f2610862fe768720 (diff) | |
download | nextcloud-server-3e235b2699037e1ed3c43e848e2c0e2334b232d8.tar.gz nextcloud-server-3e235b2699037e1ed3c43e848e2c0e2334b232d8.zip |
merge master
Diffstat (limited to 'lib')
-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']; |