]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: add search parameters to getHeadlines (bump API level)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 19 Jan 2012 10:07:59 +0000 (14:07 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 19 Jan 2012 10:07:59 +0000 (14:07 +0400)
classes/api.php
include/functions.php

index 96d3947ecd50b63b69d0223f0598455cad0e40b8..cd140172c480468665dc89ecf7d82a10214ccbbd 100644 (file)
@@ -2,7 +2,7 @@
 
 class API extends Handler {
 
-       const API_LEVEL  = 1;
+       const API_LEVEL  = 2;
 
        const STATUS_OK  = 0;
        const STATUS_ERR = 1;
@@ -170,9 +170,15 @@ class API extends Handler {
                        $include_attachments = (bool)db_escape_string($_REQUEST["include_attachments"]);
                        $since_id = (int)db_escape_string($_REQUEST["since_id"]);
 
+                       /* do not rely on params below */
+
+                       $search = db_escape_string($_REQUEST["search"]);
+                       $search_mode = db_escape_string($_REQUEST["search_mode"]);
+                       $match_on = db_escape_string($_REQUEST["match_on"]);
+
                        $headlines = api_get_headlines($this->link, $feed_id, $limit, $offset,
                                $filter, $is_cat, $show_excerpt, $show_content, $view_mode, false,
-                               $include_attachments, $since_id);
+                               $include_attachments, $since_id, $search, $search_mode, $match_on);
 
                        print $this->wrap(self::STATUS_OK, $headlines);
                } else {
index e35d7c1c669f1b4c28e01146a27a08979146ea3e..f0b90b6f64ddfed9738b9b5a4090614b5fe377c8 100644 (file)
 
        function api_get_headlines($link, $feed_id, $limit, $offset,
                                $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order,
-                               $include_attachments, $since_id) {
-
-                       /* do not rely on params below */
-
-                       $search = db_escape_string($_REQUEST["search"]);
-                       $search_mode = db_escape_string($_REQUEST["search_mode"]);
-                       $match_on = db_escape_string($_REQUEST["match_on"]);
+                               $include_attachments, $since_id,
+                               $search = "", $search_mode = "", $match_on = "") {
 
                        $qfh_ret = queryFeedHeadlines($link, $feed_id, $limit,
                                $view_mode, $is_cat, $search, $search_mode, $match_on,