From a9c966244e026b7fc8f3ffacaf493da1e75b9fa5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 7 Jul 2009 15:11:19 -0600 Subject: [PATCH] Fix return from getBodyPart() --- imp/lib/Contents.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 ''; -- 2.11.0