summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-07 14:47:35 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-07 14:47:35 +0100
commita61fa5b52675d0f1742c0dbe605df7a816ce1570 (patch)
tree9fe13224cb2a1b1a729b72211f2b3482309a3130 /apps
parent8ef760eb5d213844767ef4b79777b4e90a467ef7 (diff)
parentdbea268332aef3c9f3053f9fe55fbaa9ea43b7d8 (diff)
downloadnextcloud-server-a61fa5b52675d0f1742c0dbe605df7a816ce1570.tar.gz
nextcloud-server-a61fa5b52675d0f1742c0dbe605df7a816ce1570.zip
Merge pull request #22902 from owncloud/share-archivenamedownloadall
Fix archive file name when downloading public share
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/js/public.js6
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php2
2 files changed, 5 insertions, 3 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index da83044714e..70d5d619c12 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -158,9 +158,11 @@ OCA.Sharing.PublicApp = {
filename = JSON.stringify(filename);
}
var params = {
- path: path,
- files: filename
+ path: path
};
+ if (filename) {
+ params.files = filename;
+ }
return OC.generateUrl('/s/' + token + '/download') + '?' + OC.buildQueryString(params);
};
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index 84143d85e47..ea024b6016a 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -479,7 +479,7 @@ class ShareController extends Controller {
$this->emitAccessShareHook($share);
// download selected files
- if (!is_null($files)) {
+ if (!is_null($files) && $files !== '') {
// FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well
// after dispatching the request which results in a "Cannot modify header information" notice.
OC_Files::get($originalSharePath, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');