[Autocomplete] Fix postgres incompatible query in AutocompleteAction
This commit is contained in:
parent
2a82f2774d
commit
6ea0d441cd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user