diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 12:50:28 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 12:50:28 +0200 |
commit | 87f01ea2e97715ac5df4ef7a6741cc26f3a5cd1b (patch) | |
tree | 558818975ac41403e7d55ad07c5b0ac29806e907 /inc/3rdparty/libraries/feedwriter/FeedWriter.php | |
parent | ab157bbb75ba226917145c9bf906cbf764a85cd0 (diff) | |
parent | 0b9bb8cb7868f24137c5d8b85c39cc88ea877411 (diff) | |
download | wallabag-87f01ea2e97715ac5df4ef7a6741cc26f3a5cd1b.tar.gz wallabag-87f01ea2e97715ac5df4ef7a6741cc26f3a5cd1b.tar.zst wallabag-87f01ea2e97715ac5df4ef7a6741cc26f3a5cd1b.zip |
Merge pull request #707 from mariroz/dev
update to 3.2 version of full-text-rss, issue #694
Diffstat (limited to 'inc/3rdparty/libraries/feedwriter/FeedWriter.php')
-rwxr-xr-x | inc/3rdparty/libraries/feedwriter/FeedWriter.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/inc/3rdparty/libraries/feedwriter/FeedWriter.php b/inc/3rdparty/libraries/feedwriter/FeedWriter.php index d708e99b..77755690 100755 --- a/inc/3rdparty/libraries/feedwriter/FeedWriter.php +++ b/inc/3rdparty/libraries/feedwriter/FeedWriter.php | |||
@@ -97,15 +97,12 @@ define('JSONP', 3, true); | |||
97 | header('X-content-type-options: nosniff'); | 97 | header('X-content-type-options: nosniff'); |
98 | } elseif ($this->version == JSON) { | 98 | } elseif ($this->version == JSON) { |
99 | header('Content-type: application/json; charset=UTF-8'); | 99 | header('Content-type: application/json; charset=UTF-8'); |
100 | $this->json = new stdClass(); | ||
100 | } elseif ($this->version == JSONP) { | 101 | } elseif ($this->version == JSONP) { |
101 | header('Content-type: application/javascript; charset=UTF-8'); | 102 | header('Content-type: application/javascript; charset=UTF-8'); |
103 | $this->json = new stdClass(); | ||
102 | } | 104 | } |
103 | } | 105 | } |
104 | |||
105 | if ($this->version == JSON || $this->version == JSONP) { | ||
106 | $this->json = new stdClass(); | ||
107 | } | ||
108 | |||
109 | 106 | ||
110 | $this->printHead(); | 107 | $this->printHead(); |
111 | $this->printChannels(); | 108 | $this->printChannels(); |
@@ -116,6 +113,11 @@ define('JSONP', 3, true); | |||
116 | } | 113 | } |
117 | } | 114 | } |
118 | 115 | ||
116 | public function &getItems() | ||
117 | { | ||
118 | return $this->items; | ||
119 | } | ||
120 | |||
119 | /** | 121 | /** |
120 | * Create a new FeedItem. | 122 | * Create a new FeedItem. |
121 | * | 123 | * |
@@ -199,7 +201,8 @@ define('JSONP', 3, true); | |||
199 | */ | 201 | */ |
200 | public function setDescription($description) | 202 | public function setDescription($description) |
201 | { | 203 | { |
202 | $this->setChannelElement('description', $description); | 204 | $tag = ($this->version == ATOM)? 'subtitle' : 'description'; |
205 | $this->setChannelElement($tag, $desciption); | ||
203 | } | 206 | } |
204 | 207 | ||
205 | /** | 208 | /** |
@@ -244,7 +247,7 @@ define('JSONP', 3, true); | |||
244 | { | 247 | { |
245 | $out = '<?xml version="1.0" encoding="utf-8"?>'."\n"; | 248 | $out = '<?xml version="1.0" encoding="utf-8"?>'."\n"; |
246 | if ($this->xsl) $out .= '<?xml-stylesheet type="text/xsl" href="'.htmlspecialchars($this->xsl).'"?>' . PHP_EOL; | 249 | if ($this->xsl) $out .= '<?xml-stylesheet type="text/xsl" href="'.htmlspecialchars($this->xsl).'"?>' . PHP_EOL; |
247 | $out .= '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">' . PHP_EOL; | 250 | $out .= '<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">' . PHP_EOL; |
248 | echo $out; | 251 | echo $out; |
249 | } | 252 | } |
250 | elseif ($this->version == JSON || $this->version == JSONP) | 253 | elseif ($this->version == JSON || $this->version == JSONP) |