From d6cda3f2a6644dfab6694780de5c6556ed9f4dd9 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 1390eedf26e..595e21825f3 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -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 {