aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-08-05 13:09:33 -0100
committerMaxence Lange <maxence@artificial-owl.com>2024-08-05 13:40:53 -0100
commit6c4b0dba7728b435446d199de595a39bf731c946 (patch)
treef2ea49d85757c1b763a35344446003ea0eaefa38 /apps
parent6dc614cb3115244a9d1a889c4e92252f157aef05 (diff)
downloadnextcloud-server-6c4b0dba7728b435446d199de595a39bf731c946.tar.gz
nextcloud-server-6c4b0dba7728b435446d199de595a39bf731c946.zip
fix(inherited-shares): ignore top root folder
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index d71e07c0d4d..bc85da36d27 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -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;
}