diff options
Diffstat (limited to 'classes/rpc.php')
-rw-r--r-- | classes/rpc.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/classes/rpc.php b/classes/rpc.php index cb3eeda98..35de3362a 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -2,7 +2,7 @@ class RPC extends Handler_Protected { function csrf_ignore($method) { - $csrf_ignored = array("sanitycheck", "buttonplugin", "exportget", "sharepopup"); + $csrf_ignored = array("sanitycheck", "buttonplugin", "exportget", "completelabels"); return array_search($method, $csrf_ignored) !== false; } @@ -426,6 +426,23 @@ class RPC extends Handler_Protected { print json_encode(array("link" => $new_link)); } + function completeLabels() { + $search = db_escape_string($_REQUEST["search"]); + + $result = db_query($this->link, "SELECT DISTINCT caption FROM + ttrss_labels2 + WHERE owner_uid = '".$_SESSION["uid"]."' AND + LOWER(caption) LIKE LOWER('$search%') ORDER BY caption + LIMIT 5"); + + print "<ul>"; + while ($line = db_fetch_assoc($result)) { + print "<li>" . $line["caption"] . "</li>"; + } + print "</ul>"; + } + + function completeTags() { $search = db_escape_string($_REQUEST["search"]); |