summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-08-06 11:08:17 -0100
committerGitHub <noreply@github.com>2024-08-06 11:08:17 -0100
commitb6e3009e12485536ca72225f7d6e6a92914c15bf (patch)
treeab578d47cef3a6ba163f56c6269caa6efdbb9481 /apps/files_sharing/lib/Controller
parent5c54a3caa752d2faa8363bf1c37658705864f729 (diff)
parent6c4b0dba7728b435446d199de595a39bf731c946 (diff)
downloadnextcloud-server-b6e3009e12485536ca72225f7d6e6a92914c15bf.tar.gz
nextcloud-server-b6e3009e12485536ca72225f7d6e6a92914c15bf.zip
Merge pull request #47043 from nextcloud/fix/noid/ignore-root-on-inherited-shares
fix(inherited-shares): ignore top root folder
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-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;
}