diff options
author | Maryana Rozhankivska <mariroz@mr.lviv.ua> | 2014-04-24 11:48:00 +0300 |
---|---|---|
committer | Maryana Rozhankivska <mariroz@mr.lviv.ua> | 2014-04-24 11:48:00 +0300 |
commit | 827f5b42a667a9ac2ab68701c23885ae6e617907 (patch) | |
tree | 46ca80e00ea54f45ea373aeae08add7e48863568 /inc/3rdparty/libraries/feedwriter/FeedWriter.php | |
parent | 2a6440c134ee2d90a84b3e3a2e039d8fb4d83d04 (diff) | |
download | wallabag-827f5b42a667a9ac2ab68701c23885ae6e617907.tar.gz wallabag-827f5b42a667a9ac2ab68701c23885ae6e617907.tar.zst wallabag-827f5b42a667a9ac2ab68701c23885ae6e617907.zip |
fix of rss headers problem
Diffstat (limited to 'inc/3rdparty/libraries/feedwriter/FeedWriter.php')
-rwxr-xr-x | inc/3rdparty/libraries/feedwriter/FeedWriter.php | 23 |
1 files changed, 18 insertions, 5 deletions
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); | |||
87 | * @access public | 87 | * @access public |
88 | * @return void | 88 | * @return void |
89 | */ | 89 | */ |
90 | public function genarateFeed() | 90 | public function genarateFeed($withHeaders = true) |
91 | { | 91 | { |
92 | header('Content-type: text/xml; charset=UTF-8'); | 92 | if ($withHeaders) { |
93 | // this line prevents Chrome 20 from prompting download | 93 | if ($this->version == RSS2) { |
94 | // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss | 94 | header('Content-type: text/xml; charset=UTF-8'); |
95 | header('X-content-type-options: nosniff'); | 95 | // this line prevents Chrome 20 from prompting download |
96 | // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss | ||
97 | header('X-content-type-options: nosniff'); | ||
98 | } elseif ($this->version == JSON) { | ||
99 | header('Content-type: application/json; charset=UTF-8'); | ||
100 | } elseif ($this->version == JSONP) { | ||
101 | header('Content-type: application/javascript; charset=UTF-8'); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | if ($this->version == JSON || $this->version == JSONP) { | ||
106 | $this->json = new stdClass(); | ||
107 | } | ||
108 | |||
96 | 109 | ||
97 | $this->printHead(); | 110 | $this->printHead(); |
98 | $this->printChannels(); | 111 | $this->printChannels(); |