From 827f5b42a667a9ac2ab68701c23885ae6e617907 Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Thu, 24 Apr 2014 11:48:00 +0300 Subject: fix of rss headers problem --- inc/3rdparty/libraries/feedwriter/FeedWriter.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'inc/3rdparty/libraries/feedwriter') diff --git a/inc/3rdparty/libraries/feedwriter/FeedWriter.php b/inc/3rdparty/libraries/feedwriter/FeedWriter.php index 79639c0c..d708e99b 100755 --- a/inc/3rdparty/libraries/feedwriter/FeedWriter.php +++ b/inc/3rdparty/libraries/feedwriter/FeedWriter.php @@ -87,12 +87,25 @@ define('JSONP', 3, true); * @access public * @return void */ - public function genarateFeed() + public function genarateFeed($withHeaders = true) { - header('Content-type: text/xml; charset=UTF-8'); - // this line prevents Chrome 20 from prompting download - // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss - header('X-content-type-options: nosniff'); + if ($withHeaders) { + if ($this->version == RSS2) { + header('Content-type: text/xml; charset=UTF-8'); + // this line prevents Chrome 20 from prompting download + // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss + header('X-content-type-options: nosniff'); + } elseif ($this->version == JSON) { + header('Content-type: application/json; charset=UTF-8'); + } elseif ($this->version == JSONP) { + header('Content-type: application/javascript; charset=UTF-8'); + } + } + + if ($this->version == JSON || $this->version == JSONP) { + $this->json = new stdClass(); + } + $this->printHead(); $this->printChannels(); -- cgit v1.2.3