From 8d0813c8994ba772943e7259a03b8cbac10ba039 Mon Sep 17 00:00:00 2001 From: Marnu Lombard Date: Thu, 2 Jun 2016 07:51:18 +0200 Subject: [PATCH] Add checks for subject, date & size on the message object before attempting to use them. --- src/Fetch/Message.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Fetch/Message.php b/src/Fetch/Message.php index 26e4510..384b08b 100755 --- a/src/Fetch/Message.php +++ b/src/Fetch/Message.php @@ -238,12 +238,15 @@ protected function loadMessage() /* First load the message overview information */ if(!is_object($messageOverview = $this->getOverview())) - return false; - $this->subject = MIME::decode($messageOverview->subject, self::$charset . self::$charsetAltFlag); - $this->date = strtotime($messageOverview->date); - $this->size = $messageOverview->size; + $subject = property_exists($messageOverview, 'subject')? $messageOverview->subject : ''; + $date = property_exists($messageOverview, 'date')? $messageOverview->date : ''; + $size = property_exists($messageOverview, 'size')? $messageOverview->size : ''; + + $this->subject = MIME::decode($subject, self::$charset . self::$charsetAltFlag); + $this->date = strtotime($date); + $this->size = $size; foreach (self::$flagTypes as $flag) $this->status[$flag] = ($messageOverview->$flag == 1);