From 86c749349efea7fcfddb22831b426cce05acebeb Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 12 Jun 2017 15:46:19 +0200 Subject: [PATCH] filter missing groups in share provider Signed-off-by: Robin Appelman --- lib/private/Group/Manager.php | 2 +- lib/private/Share20/DefaultShareProvider.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index 40009dbfd80..61b47fdd448 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -74,7 +74,7 @@ class Manager extends PublicEmitter implements IGroupManager { private $cachedGroups = array(); /** - * @var \OC\Group\Group[] + * @var \OC\Group\Group[][] */ private $cachedUserGroups = array(); diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 933a2a5a33e..459a409d3cc 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -743,6 +743,8 @@ class DefaultShareProvider implements IShareProvider { $qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId()))); } + + $groups = array_filter($groups, function($group) { return $group instanceof IGroup; }); $groups = array_map(function(IGroup $group) { return $group->getGID(); }, $groups); $qb->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP))) -- 2.39.5