summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-08-07 20:49:09 +0200
committerGitHub <noreply@github.com>2024-08-07 20:49:09 +0200
commitd611843651522fcd0d9c424171f516172e6b094f (patch)
treede6200a32b4d3c33af407d4217ae8e5f5f745c6f
parent8e5956ea6afa96be39c091e42b6a740958f1d678 (diff)
parent518dccaa14800ea53eef1181cf5e6a4f6d7323b5 (diff)
downloadnextcloud-server-d611843651522fcd0d9c424171f516172e6b094f.tar.gz
nextcloud-server-d611843651522fcd0d9c424171f516172e6b094f.zip
Merge pull request #47067 from nextcloud/backport/47043/stable28
[stable28] fix(inherited-shares): ignore top root folder
-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 bd95c412833..c7b9235bb27 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -1103,8 +1103,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;
}