summaryrefslogtreecommitdiff
path: root/actions/twitapisearchjson.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-06-14 16:39:31 +0800
committerJeffery To <jeffery.to@gmail.com>2009-06-14 16:39:31 +0800
commitf7d488d4b2bfdc8dfa6b5a2bc2931dbf824509a0 (patch)
tree556bebe3785cd5e98320af8a59a119d442ec8810 /actions/twitapisearchjson.php
parent77c94c44a622052366dcc03fee522232672d71d9 (diff)
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.
Diffstat (limited to 'actions/twitapisearchjson.php')
-rw-r--r--actions/twitapisearchjson.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/actions/twitapisearchjson.php b/actions/twitapisearchjson.php
index b0e3be687..27a717bfc 100644
--- a/actions/twitapisearchjson.php
+++ b/actions/twitapisearchjson.php
@@ -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;
}
-} \ No newline at end of file
+}