diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-03-26 01:56:47 -0700 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-03-26 01:56:47 -0700 |
commit | d121180d46009dec1464d73bb0f769b0b62a00d9 (patch) | |
tree | 31b30e2dca6ea09aa90436bac238228b63336744 /apps/files_sharing | |
parent | d16dd1ad2aaeb322cd3b1f40dcf367de968cf701 (diff) | |
parent | f971ce0b66ba32b1946df493ab5a937e4a778548 (diff) | |
download | nextcloud-server-d121180d46009dec1464d73bb0f769b0b62a00d9.tar.gz nextcloud-server-d121180d46009dec1464d73bb0f769b0b62a00d9.zip |
Merge pull request #2270 from owncloud/fix_json_encoded_pubic_download
let public link download handle json encoded file lists [master]
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/public.php | 8 |
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); } |