From 02f48b84678fd71b346c1e775ca5497799119ef5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 14 Nov 2008 16:59:36 -0700 Subject: [PATCH] Need to recurse since new Parts may also contain embedded parts. --- imp/lib/Contents.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 52e81ee60..f9a091afe 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -693,13 +693,13 @@ class IMP_Contents return; } $this->_build = true; - $parts = $this->_message->contentTypeMap(); + $parts = array_keys($this->_message->contentTypeMap()); } $last_id = null; $to_process = array(); - foreach (array_keys($parts) as $id) { + foreach ($parts as $id) { if (!is_null($last_id) && (strpos($id, $last_id) === 0)) { continue; @@ -717,13 +717,11 @@ class IMP_Contents if (!is_null($new_part)) { if (is_a($new_part, 'Horde_Mime_Message')) { $this->_message = $new_part; - break; + $this->_build = false; + return $this->_buildMessage(); } $this->_message->alterPart($id, $new_part); - $to_process = array_merge($to_process, array_slice($new_part->contentTypeMap(), 1)); - if ($id == 0) { - break; - } + $to_process = array_merge($to_process, array_keys($new_part->contentTypeMap())); $last_id = $id; } } -- 2.11.0