summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-29 16:22:08 +0300
committerAndrew Dolgov <[email protected]>2010-11-29 16:22:16 +0300
commit0fe841efb91d208b2a348b4849a652ed346357d0 (patch)
tree742f059fd27e570b224839b79bc090ef548aeb3c /modules
parent4a16bda3d06b2d7e17602e52f3cfc1fd5a2a2a2e (diff)
rpc/digest-get-contents: use JSON
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 7c26d2ec4..fe4b6d302 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -608,24 +608,18 @@
}
if ($subop == "digest-get-contents") {
+ header("Content-Type: text/plain");
+
$article_id = db_escape_string($_REQUEST['article_id']);
$result = db_query($link, "SELECT content
FROM ttrss_entries, ttrss_user_entries
WHERE id = '$article_id' AND ref_id = id AND owner_uid = ".$_SESSION['uid']);
- print "<rpc-reply>";
-
- print "<article id=\"$article_id\"><![CDATA[";
-
$content = sanitize_rss($link, db_fetch_result($result, 0, "content"));
- print $content;
-
- print "]]></article>";
-
- print "</rpc-reply>";
-
+ print json_encode(array("article" =>
+ array("id" => $id, "content" => $content)));
return;
}