]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Group.php
Changed to null-coalscing style (??) as sugguested by @MrPetovan
[friendica.git] / src / Model / Group.php
index da77335f12ed944a515bf26d74be052aadde0644..fa41d26467fc704034b706306a7ee81975b69467 100644 (file)
@@ -358,14 +358,18 @@ class Group
                        throw new HTTPException\NotFoundException('Group not found.');
                }
 
+               $contactIds = [];
+
                foreach ($contacts as $cid) {
                        $cdata = Contact::getPublicAndUserContactID($cid, $group['uid']);
                        if (empty($cdata['user'])) {
                                throw new HTTPException\NotFoundException('Invalid contact.');
                        }
 
-                       DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $cdata['user']]);
+                       $contactIds[] = $cdata['user'];
                }
+
+               DBA::delete('group_member', ['gid' => $gid, 'contact-id' => $contactIds]);
        }
 
        /**