folder-share: prevent files
parent
bd85a16f02
commit
f136d511da
|
@ -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()));
|
||||
|
||||
|
|
Loading…
Reference in New Issue