aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/feedwriter/FeedWriter.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/libraries/feedwriter/FeedWriter.php')
-rwxr-xr-xinc/3rdparty/libraries/feedwriter/FeedWriter.php17
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)