summaryrefslogtreecommitdiff
path: root/actions/noticesearchrss.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-06-30 15:38:14 -0700
committerZach Copley <zach@controlyourself.ca>2009-06-30 15:38:14 -0700
commit190d45cd05a1affbc8d0db50a487b5081f6a34cb (patch)
tree0c6ceec8fda3de7223b56b1c1f7addf27edde9cd /actions/noticesearchrss.php
parentc2c631d19dad52e528d633ddd6729bf35d9fd60c (diff)
parent71dc910a53eb2aba509c418e7ac0f8e9b94cba9a (diff)
Merge commit 'jeff-themovie/notice-search-no-results' into 0.8.x
* commit 'jeff-themovie/notice-search-no-results': Fixes the notice search RSS feeds / API results for searches that return no matches.
Diffstat (limited to 'actions/noticesearchrss.php')
-rw-r--r--actions/noticesearchrss.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php
index c1bf3bf5f..2a4b2060d 100644
--- a/actions/noticesearchrss.php
+++ b/actions/noticesearchrss.php
@@ -67,11 +67,16 @@ class NoticesearchrssAction extends Rss10Action
if (!$limit) $limit = 20;
$search_engine->limit(0, $limit, true);
- $search_engine->query($q);
- $notice->find();
+ if (false === $search_engine->query($q)) {
+ $cnt = 0;
+ } else {
+ $cnt = $notice->find();
+ }
- while ($notice->fetch()) {
- $notices[] = clone($notice);
+ if ($cnt > 0) {
+ while ($notice->fetch()) {
+ $notices[] = clone($notice);
+ }
}
return $notices;