diff options
author | tcit <tcit@tcit.fr> | 2014-06-07 16:36:57 +0200 |
---|---|---|
committer | tcit <tcit@tcit.fr> | 2014-06-07 16:36:57 +0200 |
commit | 35d4e27588d3e7a6ace1f6b101d909f1eceafac9 (patch) | |
tree | f070a9789d6c125a0c1141e385b59cf0a42247e6 /inc/3rdparty/libraries/feedwriter/FeedWriter.php | |
parent | ec15d0a784a84e07b284c76e71fd8496e00559d5 (diff) | |
parent | c93a5c137fcabcf771e7bd2d16d3b8d819de16da (diff) | |
download | wallabag-35d4e27588d3e7a6ace1f6b101d909f1eceafac9.tar.gz wallabag-35d4e27588d3e7a6ace1f6b101d909f1eceafac9.tar.zst wallabag-35d4e27588d3e7a6ace1f6b101d909f1eceafac9.zip |
up to date
Diffstat (limited to 'inc/3rdparty/libraries/feedwriter/FeedWriter.php')
-rwxr-xr-x | inc/3rdparty/libraries/feedwriter/FeedWriter.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/3rdparty/libraries/feedwriter/FeedWriter.php b/inc/3rdparty/libraries/feedwriter/FeedWriter.php index d708e99b..9446cddf 100755 --- a/inc/3rdparty/libraries/feedwriter/FeedWriter.php +++ b/inc/3rdparty/libraries/feedwriter/FeedWriter.php | |||
@@ -2,6 +2,7 @@ | |||
2 | define('RSS2', 1, true); | 2 | define('RSS2', 1, true); |
3 | define('JSON', 2, true); | 3 | define('JSON', 2, true); |
4 | define('JSONP', 3, true); | 4 | define('JSONP', 3, true); |
5 | define('ATOM', 4, true); | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * Univarsel Feed Writer class | 8 | * Univarsel Feed Writer class |
@@ -101,11 +102,11 @@ define('JSONP', 3, true); | |||
101 | header('Content-type: application/javascript; charset=UTF-8'); | 102 | header('Content-type: application/javascript; charset=UTF-8'); |
102 | } | 103 | } |
103 | } | 104 | } |
104 | 105 | ||
105 | if ($this->version == JSON || $this->version == JSONP) { | 106 | if ($this->version == JSON || $this->version == JSONP) { |
106 | $this->json = new stdClass(); | 107 | $this->json = new stdClass(); |
107 | } | 108 | } |
108 | 109 | ||
109 | 110 | ||
110 | $this->printHead(); | 111 | $this->printHead(); |
111 | $this->printChannels(); | 112 | $this->printChannels(); |
@@ -116,6 +117,11 @@ define('JSONP', 3, true); | |||
116 | } | 117 | } |
117 | } | 118 | } |
118 | 119 | ||
120 | public function &getItems() | ||
121 | { | ||
122 | return $this->items; | ||
123 | } | ||
124 | |||
119 | /** | 125 | /** |
120 | * Create a new FeedItem. | 126 | * Create a new FeedItem. |
121 | * | 127 | * |
@@ -199,7 +205,8 @@ define('JSONP', 3, true); | |||
199 | */ | 205 | */ |
200 | public function setDescription($description) | 206 | public function setDescription($description) |
201 | { | 207 | { |
202 | $this->setChannelElement('description', $description); | 208 | $tag = ($this->version == ATOM)? 'subtitle' : 'description'; |
209 | $this->setChannelElement($tag, $description); | ||
203 | } | 210 | } |
204 | 211 | ||
205 | /** | 212 | /** |
@@ -244,7 +251,7 @@ define('JSONP', 3, true); | |||
244 | { | 251 | { |
245 | $out = '<?xml version="1.0" encoding="utf-8"?>'."\n"; | 252 | $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; | 253 | 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; | 254 | $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; | 255 | echo $out; |
249 | } | 256 | } |
250 | elseif ($this->version == JSON || $this->version == JSONP) | 257 | elseif ($this->version == JSON || $this->version == JSONP) |