From: Michael M Slusarz Date: Tue, 7 Jul 2009 21:11:19 +0000 (-0600) Subject: Fix return from getBodyPart() X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a9c966244e026b7fc8f3ffacaf493da1e75b9fa5;p=horde.git Fix return from getBodyPart() --- diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index a62367471..1e8fc497e 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -203,8 +203,10 @@ class IMP_Contents * DEFAULT: No * * - * @return mixed The text of the part, or a stream resource if 'stream' - * is true. + * @return mixed The text of the part, a stream resource if 'stream' + * is true and 'mimeheaders' is false, or an array of + * header text and a body stream resource if 'stream' is + * true and 'mimeheaders' is true. */ public function getBodyPart($id, $options = array()) { @@ -241,7 +243,9 @@ class IMP_Contents } return $res[$this->_index]['bodypart'][$id]; } else { - return $res[$this->_index]['mimeheader'][$id] . $res[$this->_index]['bodypart'][$id]; + return empty($options['stream']) + ? $res[$this->_index]['mimeheader'][$id] . $res[$this->_index]['bodypart'][$id] + : array($res[$this->_index]['mimeheader'][$id], $res[$this->_index]['bodypart'][$id]); } } catch (Horde_Imap_Client_Exception $e) { return '';