Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-02-28 18:25:09 +0300
committerJoas Schilling <coding@schilljs.com>2020-02-28 18:25:09 +0300
commita792a31448b1886b29a7efb0f0d032db35ebeada (patch)
treefdb0d75073b3eb71755c5cea99135abbe9250ad7 /apps/files_sharing/lib
parentde34786303291adc09034442e97d4a76e6a453d1 (diff)
Allow single file downloads so the video player works again
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 0cb0b4eb5fa..72168b3c316 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -545,10 +545,6 @@ class ShareController extends AuthPublicShareController {
throw new NotFoundException();
}
- if ($share->getHideDownload()) {
- return new NotFoundResponse();
- }
-
$userFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
$originalSharePath = $userFolder->getRelativePath($share->getNode()->getPath());
@@ -578,11 +574,17 @@ class ShareController extends AuthPublicShareController {
if ($node instanceof \OCP\Files\File) {
// Single file download
$this->singleFileDownloaded($share, $share->getNode());
- } else if (!empty($files_list)) {
- $this->fileListDownloaded($share, $files_list, $node);
} else {
- // The folder is downloaded
- $this->singleFileDownloaded($share, $share->getNode());
+ if ($share->getHideDownload()) {
+ return new NotFoundResponse();
+ }
+
+ if (!empty($files_list)) {
+ $this->fileListDownloaded($share, $files_list, $node);
+ } else {
+ // The folder is downloaded
+ $this->singleFileDownloaded($share, $share->getNode());
+ }
}
}