summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-08-05 13:09:33 -0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-08-06 12:11:46 +0000
commit518dccaa14800ea53eef1181cf5e6a4f6d7323b5 (patch)
treefed8a74609457682e67070cdb16207d465913ceb
parent6d44811cffa727d4ff1ffe030f0e9951ea212c71 (diff)
downloadnextcloud-server-518dccaa14800ea53eef1181cf5e6a4f6d7323b5.tar.gz
nextcloud-server-518dccaa14800ea53eef1181cf5e6a4f6d7323b5.zip
fix(inherited-shares): ignore top root folder
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-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;
}