summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-17 17:19:24 +0100
committerRobin Appelman <robin@icewind.nl>2022-03-31 17:25:56 +0200
commite83ad8cfad0c6bcbe8f633c362e2e136d765c499 (patch)
tree7a9b15e431833a0294528f3683a0351bf02574a2 /lib/private/Share20
parentbf48c0b1b4bd3677a70aa0d7c8a50a5253c4cb5b (diff)
downloadnextcloud-server-e83ad8cfad0c6bcbe8f633c362e2e136d765c499.tar.gz
nextcloud-server-e83ad8cfad0c6bcbe8f633c362e2e136d765c499.zip
fix shared mount roots not being returned from `getSharesInFolder`
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index 6e8d9105a76..9638706025b 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -670,8 +670,21 @@ class DefaultShareProvider implements IShareProvider {
);
}
+ // todo? maybe get these from the oc_mounts table
+ $childMountNodes = array_filter($node->getDirectoryListing(), function (Node $node) {
+ return $node->getInternalPath() === '';
+ });
+ $childMountRootIds = array_map(function (Node $node) {
+ return $node->getId();
+ }, $childMountNodes);
+
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
- $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
+ $qb->andWhere(
+ $qb->expr()->orX(
+ $qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())),
+ $qb->expr()->in('f.fileid', $qb->createNamedParameter($childMountRootIds, IQueryBuilder::PARAM_INT_ARRAY))
+ )
+ );
$qb->orderBy('id');