]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/libraries/feedwriter/FeedWriter.php
update to 3.2 version of full-text-rss, issue #694
[github/wallabag/wallabag.git] / inc / 3rdparty / libraries / feedwriter / FeedWriter.php
index d708e99b0ec36e12dce2dcc6309410f3f8e598dc..7775569033cc9e3c1acf81832f7c1b2dc36946dd 100755 (executable)
@@ -97,15 +97,12 @@ define('JSONP', 3, true);
               header('X-content-type-options: nosniff');\r
           } elseif ($this->version == JSON) {\r
               header('Content-type: application/json; charset=UTF-8');\r
+              $this->json = new stdClass();\r
           } elseif ($this->version == JSONP) {\r
               header('Content-type: application/javascript; charset=UTF-8');\r
+              $this->json = new stdClass();\r
           }\r
         }\r
-      \r
-        if ($this->version == JSON || $this->version == JSONP) {\r
-          $this->json = new stdClass();\r
-        }\r
-      \r
 \r
         $this->printHead();\r
         $this->printChannels();\r
@@ -116,6 +113,11 @@ define('JSONP', 3, true);
         }\r
     }\r
 \r
+    public function &getItems()\r
+    {\r
+       return $this->items;\r
+    }\r
+\r
     /**\r
     * Create a new FeedItem.\r
     *\r
@@ -199,7 +201,8 @@ define('JSONP', 3, true);
     */\r
     public function setDescription($description)\r
     {\r
-        $this->setChannelElement('description', $description);\r
+        $tag = ($this->version == ATOM)? 'subtitle' : 'description';\r
+        $this->setChannelElement($tag, $desciption);\r
     }\r
 \r
     /**\r
@@ -244,7 +247,7 @@ define('JSONP', 3, true);
         {\r
             $out  = '<?xml version="1.0" encoding="utf-8"?>'."\n";\r
             if ($this->xsl) $out .= '<?xml-stylesheet type="text/xsl" href="'.htmlspecialchars($this->xsl).'"?>' . PHP_EOL;\r
-            $out .= '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">' . PHP_EOL;\r
+            $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;\r
             echo $out;\r
         }\r
         elseif ($this->version == JSON || $this->version == JSONP)\r