summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-13 11:15:17 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-13 11:15:17 +0100
commitf971ce0b66ba32b1946df493ab5a937e4a778548 (patch)
tree3a83ed58256a7ccb7331163f504eb499640e50ac /apps/files_sharing
parentf3a2daaa9d4fd574236b9168cdd6b0598d8578ce (diff)
downloadnextcloud-server-f971ce0b66ba32b1946df493ab5a937e4a778548.tar.gz
nextcloud-server-f971ce0b66ba32b1946df493ab5a937e4a778548.zip
let public link download handle json encoded file lists
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/public.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 1da972ad7e3..c8aca498f8c 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -113,7 +113,13 @@ if (isset($path)) {
// Download the file
if (isset($_GET['download'])) {
if (isset($_GET['files'])) { // download selected files
- OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ $files = urldecode($_GET['files']);
+ $files_list = json_decode($files);
+ // in case we get only a single file
+ if ($files_list === NULL ) {
+ $files_list = array($files);
+ }
+ OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else {
OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}