forked from GNUsocial/gnu-social
Fixes the notice search RSS feeds / API results for searches that return no matches.
If a user does a notice search that should return no matching notices, the RSS feed / API results for that search currently returns all notices instead of no notices. This fixes it so that an empty list is returned instead.
This commit is contained in:
@@ -124,8 +124,11 @@ class TwitapisearchjsonAction extends TwitterapiAction
|
||||
$search_engine = $notice->getSearchEngine('identica_notices');
|
||||
$search_engine->set_sort_mode('chron');
|
||||
$search_engine->limit(($this->page - 1) * $this->rpp, $this->rpp + 1, true);
|
||||
$search_engine->query($q);
|
||||
$cnt = $notice->find();
|
||||
if (false === $search_engine->query($q)) {
|
||||
$cnt = 0;
|
||||
} else {
|
||||
$cnt = $notice->find();
|
||||
}
|
||||
|
||||
// TODO: since_id, lang, geocode
|
||||
|
||||
@@ -146,4 +149,4 @@ class TwitapisearchjsonAction extends TwitterapiAction
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user