From 6c4b0dba7728b435446d199de595a39bf731c946 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 5 Aug 2024 13:09:33 -0100 Subject: [PATCH] fix(inherited-shares): ignore top root folder Signed-off-by: Maxence Lange --- apps/files_sharing/lib/Controller/ShareAPIController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index d71e07c0d4d09..bc85da36d2759 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1078,8 +1078,11 @@ public function getInheritedShares(string $path): DataResponse { // generate node list for each parent folders /** @var Node[] $nodes */ $nodes = []; - while ($node->getPath() !== $basePath) { + while (true) { $node = $node->getParent(); + if ($node->getPath() === $basePath) { + break; + } $nodes[] = $node; }