From 3dc8d84229ed0f3ccd40b44420ed6e818a6edea9 Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Thu, 29 May 2014 16:35:00 +0300 Subject: [PATCH] fix of uninitialized object warning, issue #710 --- inc/3rdparty/libraries/feedwriter/FeedWriter.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/3rdparty/libraries/feedwriter/FeedWriter.php b/inc/3rdparty/libraries/feedwriter/FeedWriter.php index 7775569..aa064af 100755 --- a/inc/3rdparty/libraries/feedwriter/FeedWriter.php +++ b/inc/3rdparty/libraries/feedwriter/FeedWriter.php @@ -97,13 +97,16 @@ 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(); $this->printItems(); @@ -202,7 +205,7 @@ define('JSONP', 3, true); public function setDescription($description) { $tag = ($this->version == ATOM)? 'subtitle' : 'description'; - $this->setChannelElement($tag, $desciption); + $this->setChannelElement($tag, $description); } /**