When formatting a share node an Empty target is invalid

Fixes #9028

For federated shares the share table holds no target information (since
it is on the other server). So when a node is actually invalid and not
found we should not display it anymore in the shared with sections etc
and thus throw the proper exceptions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-04-04 11:33:05 +02:00
parent b90b73df6f
commit d6cda3f2a6
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -154,7 +154,7 @@ class ShareAPIController extends OCSController {
if (empty($nodes)) {
// fallback to guessing the path
$node = $userFolder->get($share->getTarget());
if ($node === null) {
if ($node === null || $share->getTarget() === '') {
throw new NotFoundException();
}
} else {