]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/3rdparty/libraries/feedwriter/FeedWriter.php
do not debug inside an epub
[github/wallabag/wallabag.git] / inc / 3rdparty / libraries / feedwriter / FeedWriter.php
index df4c8b4b7981253c841f1950066f4b6115e0b7a3..d708e99b0ec36e12dce2dcc6309410f3f8e598dc 100755 (executable)
@@ -87,20 +87,26 @@ define('JSONP', 3, true);
     * @access   public\r
     * @return   void\r
     */\r
-    public function genarateFeed()\r
+    public function genarateFeed($withHeaders = true)\r
     {\r
-        if ($this->version == RSS2) {\r
-//             header('Content-type: text/xml; charset=UTF-8');\r
-            // this line prevents Chrome 20 from prompting download\r
-            // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss\r
-//             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
+        if ($withHeaders) {\r
+          if ($this->version == RSS2) {\r
+              header('Content-type: text/xml; charset=UTF-8');\r
+              // this line prevents Chrome 20 from prompting download\r
+              // used by Google: https://news.google.com/news/feeds?ned=us&topic=b&output=rss\r
+              header('X-content-type-options: nosniff');\r
+          } elseif ($this->version == JSON) {\r
+              header('Content-type: application/json; charset=UTF-8');\r
+          } elseif ($this->version == JSONP) {\r
+              header('Content-type: application/javascript; charset=UTF-8');\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
         $this->printItems();\r