]> source.dussan.org Git - nextcloud-server.git/commitdiff
filter missing groups in share provider 5365/head
authorRobin Appelman <robin@icewind.nl>
Mon, 12 Jun 2017 13:46:19 +0000 (15:46 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Tue, 13 Jun 2017 08:54:02 +0000 (10:54 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Group/Manager.php
lib/private/Share20/DefaultShareProvider.php

index 40009dbfd80848620c4eeef01f1f784b3ddc6cc6..61b47fdd448a8b5b2da638118a360394736c99b9 100644 (file)
@@ -74,7 +74,7 @@ class Manager extends PublicEmitter implements IGroupManager {
        private $cachedGroups = array();
 
        /**
-        * @var \OC\Group\Group[]
+        * @var \OC\Group\Group[][]
         */
        private $cachedUserGroups = array();
 
index 933a2a5a33e85f008b9b8519428ef2851fa4e0f8..459a409d3cc08b7190e8145e9cc6d65d5ec30b48 100644 (file)
@@ -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)))