X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2F3rdparty%2Flibraries%2Ffeedwriter%2FFeedWriter.php;h=7775569033cc9e3c1acf81832f7c1b2dc36946dd;hb=87f01ea2e97715ac5df4ef7a6741cc26f3a5cd1b;hp=d708e99b0ec36e12dce2dcc6309410f3f8e598dc;hpb=6a3c5101577d08d65c22706dea61bba23cca782b;p=github%2Fwallabag%2Fwallabag.git 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); header('X-content-type-options: nosniff'); } elseif ($this->version == JSON) { header('Content-type: application/json; charset=UTF-8'); + $this->json = new stdClass(); } elseif ($this->version == JSONP) { header('Content-type: application/javascript; charset=UTF-8'); + $this->json = new stdClass(); } } - - if ($this->version == JSON || $this->version == JSONP) { - $this->json = new stdClass(); - } - $this->printHead(); $this->printChannels(); @@ -116,6 +113,11 @@ define('JSONP', 3, true); } } + public function &getItems() + { + return $this->items; + } + /** * Create a new FeedItem. * @@ -199,7 +201,8 @@ define('JSONP', 3, true); */ public function setDescription($description) { - $this->setChannelElement('description', $description); + $tag = ($this->version == ATOM)? 'subtitle' : 'description'; + $this->setChannelElement($tag, $desciption); } /** @@ -244,7 +247,7 @@ define('JSONP', 3, true); { $out = ''."\n"; if ($this->xsl) $out .= 'xsl).'"?>' . PHP_EOL; - $out .= '' . PHP_EOL; + $out .= '' . PHP_EOL; echo $out; } elseif ($this->version == JSON || $this->version == JSONP)