For base (ID = 0) parts, any subpart is a body part
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 7 Oct 2009 17:51:57 +0000 (11:51 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 7 Oct 2009 18:30:24 +0000 (12:30 -0600)
framework/Mime/lib/Horde/Mime/Part.php

index 8215baf..596bab3 100644 (file)
@@ -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;
             }