Merge pull request #19699 from nextcloud/bugfix/19349/allow-single-file-downloads

Allow single file downloads so the video player works again
This commit is contained in:
Roeland Jago Douma 2020-03-02 08:05:04 +01:00 committed by GitHub
commit 02999091e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,13 +574,19 @@ class ShareController extends AuthPublicShareController {
if ($node instanceof \OCP\Files\File) {
// Single file download
$this->singleFileDownloaded($share, $share->getNode());
} else if (!empty($files_list)) {
} else {
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());
}
}
}
/* FIXME: We should do this all nicely in OCP */
OC_Util::tearDownFS();