summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-01-18 17:37:44 +0400
committerAndrew Dolgov <[email protected]>2013-01-18 17:37:44 +0400
commit10bdeb4b82cc5675dcd5ef1a8aafb4d8c47c5ba3 (patch)
treedb3ccf2c077800fd9ba2851a69d620e7e83441e4 /classes
parentca3bca990d4592dbccb5cce709675d302e52ae60 (diff)
misc generated feed tweaks (fix json content-type, etc)
Diffstat (limited to 'classes')
-rw-r--r--classes/handler/public.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index ca6144bdf..3bc8d3b79 100644
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -66,7 +66,7 @@ class Handler_Public extends Handler {
if ($line['note']) {
$content = "<div style=\"$note_style\">Article note: " . $line['note'] . "</div>" .
$content;
- }
+}
$tpl->setVariable('ARTICLE_CONTENT', $content, true);
@@ -106,7 +106,11 @@ class Handler_Public extends Handler {
$tpl->addBlock('feed');
$tpl->generateOutputToString($tmp);
- header("Content-Type: text/xml; charset=utf-8");
+ if (@!$_REQUEST["noxml"]) {
+ header("Content-Type: text/xml; charset=utf-8");
+ } else {
+ header("Content-Type: text/plain; charset=utf-8");
+ }
print $tmp;
} else if ($format == 'json') {
@@ -165,8 +169,7 @@ class Handler_Public extends Handler {
array_push($feed['articles'], $article);
}
- header("Content-Type: text/plain; charset=utf-8");
-
+ header("Content-Type: text/json; charset=utf-8");
print json_encode($feed);
} else {