summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-03-17 17:19:24 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2022-04-13 21:26:16 +0200
commitef5b60e4cb77433e08877fa83fb4692e138e071f (patch)
treeb0d339b4eb08b40a7bced51d24b1700c19cd1a70
parentdf576c66fa46cdbaba172dc84cd02f5a94ea841f (diff)
downloadnextcloud-server-ef5b60e4cb77433e08877fa83fb4692e138e071f.tar.gz
nextcloud-server-ef5b60e4cb77433e08877fa83fb4692e138e071f.zip
fix shared mount roots not being returned from `getSharesInFolder`
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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 cfc4079e117..110b81be930 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -666,8 +666,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');