]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(inherited-shares): ignore top root folder 47043/head
authorMaxence Lange <maxence@artificial-owl.com>
Mon, 5 Aug 2024 14:09:33 +0000 (13:09 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Mon, 5 Aug 2024 14:40:53 +0000 (13:40 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
apps/files_sharing/lib/Controller/ShareAPIController.php

index d71e07c0d4d09d2217e26d171a0ea3f2ae9cf236..bc85da36d27596d7d86f4e6ce3469b6262fc26be 100644 (file)
@@ -1078,8 +1078,11 @@ class ShareAPIController extends OCSController {
                // 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;
                }