aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2024-01-08 16:56:56 +0100
committerRobin Appelman <robin@icewind.nl>2024-03-06 15:33:05 +0100
commitbfeb97c54a5de25493ff1fa4fd36ae1aa2acec49 (patch)
tree49191a40b9dc41820ba9e55fe3829c4770f94693 /lib/private
parentc651e06a6d1296cbca03a706d9cded707e70af74 (diff)
downloadnextcloud-server-bfeb97c54a5de25493ff1fa4fd36ae1aa2acec49.tar.gz
nextcloud-server-bfeb97c54a5de25493ff1fa4fd36ae1aa2acec49.zip
fix: also filter by storage when getting shares in folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Share20/DefaultShareProvider.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index b4ec16936f3..50196402b42 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -692,17 +692,24 @@ class DefaultShareProvider implements IShareProvider {
}, $childMountNodes);
$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
+ $storageFilter = $qb->expr()->eq('f.storage', $qb->createNamedParameter($node->getMountPoint()->getNumericStorageId(), IQueryBuilder::PARAM_INT));
if ($shallow) {
$qb->andWhere(
$qb->expr()->orX(
- $qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())),
+ $qb->expr()->andX(
+ $storageFilter,
+ $qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())),
+ ),
$qb->expr()->in('f.fileid', $qb->createParameter('chunk'))
)
);
} else {
$qb->andWhere(
$qb->expr()->orX(
- $qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConn->escapeLikeParameter($node->getInternalPath()) . '/%')),
+ $qb->expr()->andX(
+ $storageFilter,
+ $qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConn->escapeLikeParameter($node->getInternalPath()) . '/%')),
+ ),
$qb->expr()->in('f.fileid', $qb->createParameter('chunk'))
)
);