From 36bd4b7ddee48fcbb442c8c03955114608dee1b1 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 4 Apr 2018 11:33:05 +0200 Subject: [PATCH] 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 --- apps/files_sharing/lib/Controller/ShareAPIController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 82a93c446e2..470e4c53c5c 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -147,7 +147,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 {