summaryrefslogtreecommitdiff
path: root/modules/backend-rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-29 16:19:32 +0300
committerAndrew Dolgov <[email protected]>2010-11-29 16:19:40 +0300
commit4a16bda3d06b2d7e17602e52f3cfc1fd5a2a2a2e (patch)
treef6fff704537cf7bb70b6c382fea5745ef28ccec6 /modules/backend-rpc.php
parentda661d71db322c0a67109f7ef6bfddb629456f84 (diff)
rpc/updateFeedBrowser: use JSON
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r--modules/backend-rpc.php23
1 files changed, 5 insertions, 18 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 3120fb7b3..7c26d2ec4 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -551,25 +551,18 @@
}
if ($subop == "updateFeedBrowser") {
+ header("Content-Type: text/plain");
$search = db_escape_string($_REQUEST["search"]);
$limit = db_escape_string($_REQUEST["limit"]);
- $mode = db_escape_string($_REQUEST["mode"]);
-
- print "<rpc-reply>";
- print "<content>";
- print "<![CDATA[";
- $ctr = print_feed_browser($link, $search, $limit, $mode);
- print "]]>";
- print "</content>";
- print "<num-results value=\"$ctr\"/>";
- print "<mode value=\"$mode\"/>";
- print "</rpc-reply>";
+ $mode = (int) db_escape_string($_REQUEST["mode"]);
+ print json_encode(array("content" =>
+ make_feed_browser($link, $search, $limit, $mode),
+ "mode" => $mode));
return;
}
-
if ($subop == "massSubscribe") {
$ids = split(",", db_escape_string($_REQUEST["ids"]));
@@ -611,12 +604,6 @@
}
}
- $num_feeds = count($subscribed);
-
- print "<rpc-reply>";
- print "<num-feeds value='$num_feeds'/>";
- print "</rpc-reply>";
-
return;
}