summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}