]> git.wh0rd.org Git - tt-rss.git/commitdiff
misc generated feed tweaks (fix json content-type, etc)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 18 Jan 2013 13:37:44 +0000 (17:37 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 18 Jan 2013 13:37:44 +0000 (17:37 +0400)
classes/handler/public.php

index ca6144bdff5a5844e19f8f626234d7f1546fda46..3bc8d3b794e91732dc227e312d0744c11e99f83a 100644 (file)
@@ -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 {