diff --git a/backend.php b/backend.php
index d13b2d62a..016e18986 100644
--- a/backend.php
+++ b/backend.php
@@ -48,17 +48,10 @@
$print_exec_time = false;
- if ((!$op || $op == "rpc" || $op == "rss" ||
- $op == "digestSend" || $op == "dlg" ||
- $op == "globalUpdateFeeds") && !$_REQUEST["noxml"]) {
- header("Content-Type: application/xml; charset=utf-8");
-
- } else {
- if (!$_REQUEST["noxml"]) {
- header("Content-Type: text/html; charset=utf-8");
- } else {
+ if ((!$op || $op == "rss" || $op == "dlg") && !$_REQUEST["noxml"]) {
+ header("Content-Type: application/xml; charset=utf-8");
+ } else {
header("Content-Type: text/plain; charset=utf-8");
- }
}
if (ENABLE_GZIP_OUTPUT) {
@@ -428,16 +421,8 @@
break; // pref-pub-items
case "globalUpdateFeeds":
- // update feeds of all users, may be used anonymously
-
- print "";
-
- print "
", $_REQUEST['value']);
$key = db_escape_string($_REQUEST["key"]);
@@ -155,8 +148,6 @@
}
if ($subop == "mark") {
- header("Content-Type: text/plain");
-
$mark = $_REQUEST["mark"];
$id = db_escape_string($_REQUEST["id"]);
@@ -174,8 +165,6 @@
}
if ($subop == "delete") {
- header("Content-Type: text/plain");
-
$ids = db_escape_string($_REQUEST["ids"]);
$result = db_query($link, "DELETE FROM ttrss_user_entries
@@ -186,8 +175,6 @@
}
if ($subop == "unarchive") {
- header("Content-Type: text/plain");
-
$ids = db_escape_string($_REQUEST["ids"]);
$result = db_query($link, "UPDATE ttrss_user_entries
@@ -199,8 +186,6 @@
}
if ($subop == "archive") {
- header("Content-Type: text/plain");
-
$ids = split(",", db_escape_string($_REQUEST["ids"]));
foreach ($ids as $id) {
@@ -212,8 +197,6 @@
}
if ($subop == "publ") {
- header("Content-Type: text/plain");
-
$pub = $_REQUEST["pub"];
$id = db_escape_string($_REQUEST["id"]);
$note = trim(strip_tags(db_escape_string($_REQUEST["note"])));
@@ -245,9 +228,6 @@
} */
if ($subop == "updateAllFeeds" || $subop == "getAllCounters") {
-
- header("Content-Type: text/plain");
-
$last_article_id = (int) $_REQUEST["last_article_id"];
$reply = array();
@@ -272,8 +252,6 @@
/* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */
if ($subop == "catchupSelected") {
- header("Content-Type: text/plain");
-
$ids = split(",", db_escape_string($_REQUEST["ids"]));
$cmode = sprintf("%d", $_REQUEST["cmode"]);
@@ -284,8 +262,6 @@
}
if ($subop == "markSelected") {
- header("Content-Type: text/plain");
-
$ids = split(",", db_escape_string($_REQUEST["ids"]));
$cmode = sprintf("%d", $_REQUEST["cmode"]);
@@ -296,8 +272,6 @@
}
if ($subop == "publishSelected") {
- header("Content-Type: text/plain");
-
$ids = split(",", db_escape_string($_REQUEST["ids"]));
$cmode = sprintf("%d", $_REQUEST["cmode"]);
@@ -308,8 +282,6 @@
}
if ($subop == "sanityCheck") {
- header("Content-Type: text/plain");
-
$_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true";
$reply = array();
@@ -335,8 +307,6 @@
} */
if ($subop == "setArticleTags") {
- header("Content-Type: text/plain");
-
global $memcache;
$id = db_escape_string($_REQUEST["id"]);
@@ -404,8 +374,6 @@
}
if ($subop == "regenOPMLKey") {
- header("Content-Type: text/plain");
-
update_feed_access_key($link, 'OPML:Publish',
false, $_SESSION["uid"]);
@@ -415,16 +383,7 @@
return;
}
- // XML method
- if ($subop == "logout") {
- logout_user();
- print_error_xml(6);
- return;
- }
-
if ($subop == "completeTags") {
- header("Content-Type: text/plain");
-
$search = db_escape_string($_REQUEST["search"]);
$result = db_query($link, "SELECT DISTINCT tag_name FROM ttrss_tags
@@ -472,8 +431,6 @@
} */
if ($subop == "getArticles") {
- header("Content-Type: text/plain");
-
$ids = split(",", db_escape_string($_REQUEST["ids"]));
$articles = array();
@@ -488,8 +445,6 @@
}
if ($subop == "checkDate") {
- header("Content-Type: text/plain");
-
$date = db_escape_string($_REQUEST["date"]);
$date_parsed = strtotime($date);
@@ -498,8 +453,6 @@
}
if ($subop == "assignToLabel" || $subop == "removeFromLabel") {
- header("Content-Type: text/plain");
-
$reply = array();
$ids = split(",", db_escape_string($_REQUEST["ids"]));
@@ -535,8 +488,6 @@
}
if ($subop == "updateFeedBrowser") {
- header("Content-Type: text/plain");
-
$search = db_escape_string($_REQUEST["search"]);
$limit = db_escape_string($_REQUEST["limit"]);
$mode = (int) db_escape_string($_REQUEST["mode"]);
@@ -593,8 +544,6 @@
}
if ($subop == "digest-get-contents") {
- header("Content-Type: text/plain");
-
$article_id = db_escape_string($_REQUEST['article_id']);
$result = db_query($link, "SELECT content
@@ -609,8 +558,6 @@
}
if ($subop == "digest-update") {
- header("Content-Type: text/plain");
-
$feed_id = db_escape_string($_REQUEST['feed_id']);
$offset = db_escape_string($_REQUEST['offset']);
$seq = db_escape_string($_REQUEST['seq']);
@@ -637,8 +584,6 @@
}
if ($subop == "digest-init") {
- header("Content-Type: text/plain");
-
$tmp_feeds = api_get_feeds($link, -3, true, false, 0);
$feeds = array();
@@ -662,8 +607,6 @@
}
if ($subop == "sendEmail") {
- header("Content-Type: text/plain");
-
$secretkey = $_REQUEST['secretkey'];
$reply = array();
@@ -721,8 +664,6 @@
}
if ($subop == "completeEmails") {
- header("Content-Type: text/plain");
-
$search = db_escape_string($_REQUEST["search"]);
print "