From: Michael M Slusarz Date: Tue, 7 Jul 2009 21:21:04 +0000 (-0600) Subject: Better error handling for mailbox lists X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6e009e57251bd8c4997abde84fff20d199420f7c;p=horde.git Better error handling for mailbox lists --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 1e8fc497e..4dbeb3cc3 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -129,10 +129,15 @@ class IMP_Contents $ret = $GLOBALS['imp_imap']->ob->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_STRUCTURE => array('parse' => true) ), array('ids' => array($this->_index))); - $this->_message = $ret[$this->_index]['structure']; } catch (Horde_Imap_Client_Exception $e) { throw new Horde_Exception('Error displaying message.'); } + + if (!isset($ret[$this->_index]['structure'])) { + throw new Horde_Exception('Error displaying message.'); + } + + $this->_message = $ret[$this->_index]['structure']; } } diff --git a/imp/message.php b/imp/message.php index 0733b3087..6c1c8e81d 100644 --- a/imp/message.php +++ b/imp/message.php @@ -202,6 +202,7 @@ $mailbox_name = $index_array['mailbox']; try { $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); } catch (Horde_Exception $e) { + $imp_mailbox->removeMsgs(true); _returnToMailbox(null, 'message_missing'); require IMP_BASE . '/mailbox.php'; exit;