From: Andrew Dolgov Date: Fri, 18 Jan 2013 13:37:44 +0000 (+0400) Subject: misc generated feed tweaks (fix json content-type, etc) X-Git-Tag: 1.7.0~53 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=10bdeb4b82cc5675dcd5ef1a8aafb4d8c47c5ba3;p=tt-rss.git misc generated feed tweaks (fix json content-type, etc) --- diff --git a/classes/handler/public.php b/classes/handler/public.php index ca6144bd..3bc8d3b7 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -66,7 +66,7 @@ class Handler_Public extends Handler { if ($line['note']) { $content = "
Article note: " . $line['note'] . "
" . $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 {