]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/noticesearchrss.php
Fix help text for getvaliddaemons.php
[quix0rs-gnu-social.git] / actions / noticesearchrss.php
index 0f98ed04bb97e26eebadbd30e116653e5398a5b2..2a4b2060d3fa3f2d3781d429f27cbd5a372ce9a3 100644 (file)
@@ -12,7 +12,7 @@
  * @link     http://laconi.ca/
  *
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -62,19 +62,21 @@ class NoticesearchrssAction extends Rss10Action
 
         $notice = new Notice();
 
-        # lcase it for comparison
-        $q = strtolower($q);
-
         $search_engine = $notice->getSearchEngine('identica_notices');
         $search_engine->set_sort_mode('chron');
 
         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;
@@ -95,7 +97,7 @@ class NoticesearchrssAction extends Rss10Action
         return null;
     }
 
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return true;
     }