From 6ea0d441cd36e5026f2e9ba9180547bb9469f55f Mon Sep 17 00:00:00 2001 From: susdiv Date: Fri, 5 Jun 2020 19:14:37 +0000 Subject: [PATCH] [Autocomplete] Fix postgres incompatible query in AutocompleteAction --- plugins/Autocomplete/actions/autocomplete.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/Autocomplete/actions/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php index a5478f9432..f7d79a4999 100644 --- a/plugins/Autocomplete/actions/autocomplete.php +++ b/plugins/Autocomplete/actions/autocomplete.php @@ -104,12 +104,13 @@ class AutocompleteAction extends Action if(substr($term,0,1)=='@'){ //profile search $term=substr($term,1); + $user_table = common_database_tablename('user'); $profile = new Profile(); $profile->limit($limit); $profile->whereAdd('nickname like \'' . trim($profile->escape($term), '\'') . '%\''); - $profile->whereAdd(sprintf('id in (SELECT id FROM user) OR ' + $profile->whereAdd(sprintf('id in (SELECT id FROM %s) OR ' . 'id in (SELECT subscribed from subscription' - . ' where subscriber = %d)', $this->scoped->id)); + . ' where subscriber = %d)', $user_table, $this->scoped->id)); if ($profile->find()) { while($profile->fetch()) { $this->profiles[]=clone($profile);