From: Michael M Slusarz Date: Mon, 8 Jun 2009 22:15:52 +0000 (-0600) Subject: Don't attempt to grab MIME bodypart 0 (it doesn't exist on the IMAP server) X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=46d3cb1dfb666a565d9c3891353dbe24ad596688;p=horde.git Don't attempt to grab MIME bodypart 0 (it doesn't exist on the IMAP server) --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index e31c1a7b2..67e13cdbc 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -186,6 +186,10 @@ class IMP_Contents */ public function getBodyPart($id, $options = array()) { + if (empty($id)) { + return ''; + } + if (is_null($this->_mailbox)) { // TODO: Include MIME headers? $ob = $this->getMIMEPart($id, array('nocontents' => true)); @@ -292,7 +296,11 @@ class IMP_Contents $part = $this->_message->getPart($id); - if (!is_null($part) && + /* Don't download contents of entire body if ID == 0 (indicating the + * body of the main multipart message). I'm pretty sure we never + * want to download the body of that part here. */ + if (!empty($id) && + !is_null($part) && empty($options['nocontents']) && !is_null($this->_mailbox) && !$part->getContents()) {