diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:20:00 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-02-13 20:28:52 +0100 |
commit | d5397d813cd731b5bf8ac4b7c193ac39d704af6e (patch) | |
tree | 9de3d45f938bdb755ac158933aef994cb58e257e /lib/private/files.php | |
parent | 30662fa7acbe7a367ee8b0c07afabf425a10ef06 (diff) | |
download | nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.tar.gz nextcloud-server-d5397d813cd731b5bf8ac4b7c193ac39d704af6e.zip |
Do not send file list for select all on Download/delete
- When all files are selected, do not send the whole file list
- Download will trigger download for the parent folder, also works
with root
- Delete will send "allfiles" to the server that will find the file
list or the passed directory by itself
Diffstat (limited to 'lib/private/files.php')
-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 24fca4a5df3..5bbc2e960d7 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -103,7 +103,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; @@ -198,6 +203,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']; |