From 4fd3f43ad266839399d9b9bf03d3031671d78d72 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Tue, 29 Apr 2014 23:35:46 -0400 Subject: [PATCH] Autocomplete: don't match non-subscribed group-names. There's no point, since we can't post/link to them anyway. --- plugins/Autocomplete/actions/autocomplete.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/Autocomplete/actions/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php index c6676250c0..2c5bbb41a6 100644 --- a/plugins/Autocomplete/actions/autocomplete.php +++ b/plugins/Autocomplete/actions/autocomplete.php @@ -128,6 +128,9 @@ class AutocompleteAction extends Action $group = new User_group(); $group->limit($limit); $group->whereAdd('nickname like \'' . trim($group->escape($term), '\'') . '%\''); + //Can't post to groups we're not subscribed to...: + $group->whereAdd('id in (SELECT group_id from group_member' + . ' where profile_id = ' . $cur->id . ')'); if($group->find()){ while($group->fetch()) { $this->groups[]=clone($group);