From 379bc8815bb5432509e27a7d0c8d3be11445f82b Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 7 Oct 2009 11:51:57 -0600 Subject: [PATCH] For base (ID = 0) parts, any subpart is a body part --- framework/Mime/lib/Horde/Mime/Part.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index 8215bafad..596bab361 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -1450,9 +1450,11 @@ class Horde_Mime_Part */ public function findBody($subtype = null) { + $initial_id = $this->getMimeId(); + foreach ($this->contentTypeMap() as $mime_id => $mime_type) { if ((strpos($mime_type, 'text/') === 0) && - (intval($mime_id) == 1) && + (!$initial_id || (intval($mime_id) == 1)) && (is_null($subtype) || (substr($mime_type, 5) == $subtype))) { return $mime_id; } -- 2.11.0