]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #711 from mariroz/dev
authorNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 29 May 2014 14:04:26 +0000 (16:04 +0200)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Thu, 29 May 2014 14:04:26 +0000 (16:04 +0200)
fix of uninitialized object warning, issue #710

inc/3rdparty/libraries/feedwriter/FeedWriter.php

index 7775569033cc9e3c1acf81832f7c1b2dc36946dd..aa064afba3ca0bd6914ac6e5fd1e3fff2d39ef81 100755 (executable)
@@ -97,13 +97,16 @@ 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
         $this->printItems();\r
@@ -202,7 +205,7 @@ define('JSONP', 3, true);
     public function setDescription($description)\r
     {\r
         $tag = ($this->version == ATOM)? 'subtitle' : 'description';\r
-        $this->setChannelElement($tag, $desciption);\r
+        $this->setChannelElement($tag, $description);\r
     }\r
 \r
     /**\r