From 26a9bae8321295b25db6bc10d03623d7364efb4f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 4 Dec 2008 12:48:07 -0700 Subject: [PATCH] Error catching; fix wrong varname. --- imp/lib/Views/ShowMessage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 15fa5264a..e3c2474ce 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -125,11 +125,15 @@ class IMP_Views_ShowMessage $flags_ret = $GLOBALS['imp_imap']->ob->fetch($folder, array( Horde_Imap_Client::FETCH_FLAGS => true, ), array('ids' => array($index))); + if (!isset($flags_ret[$index])) { + $result['error'] = $error_msg; + $result['errortype'] = 'horde.error'; + return $result; + } $fetch_ret = $GLOBALS['imp_imap']->ob->fetch($folder, array( Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => false)) ), array('ids' => array($index))); - $ob = $fetch_ret[$index]; } catch (Horde_Imap_Client_Exception $e) { $result['error'] = $error_msg; $result['errortype'] = 'horde.error'; @@ -210,7 +214,7 @@ class IMP_Views_ShowMessage /* Get minidate. */ if ($preview) { $imp_mailbox_ui = new IMP_UI_Mailbox(); - $minidate = $imp_mailbox_ui->getDate($ob['envelope']['date']); + $minidate = $imp_mailbox_ui->getDate($envelope['date']); if (empty($minidate)) { $minidate = _("Unknown Date"); } -- 2.11.0