diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 3b9d7ba0..ff136914 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -106,6 +106,11 @@ class PublicController extends AuthPublicShareController throw new NotFoundException(); } + if (!($share->getNode() instanceof \OCP\Files\Folder)) { + // TODO: single file share + throw new NotFoundException(); + } + // Redirect to main app if user owns this share $this->redirectIfOwned($share); @@ -207,6 +212,11 @@ class PublicController extends AuthPublicShareController return null; } + // Check if node is a folder + if (!$node instanceof \OCP\Files\Folder) { + return null; + } + // Remove user folder path from start of node path $relPath = substr($node->getPath(), \strlen($userFolder->getPath()));