Fix displaying other inline parts under the alt part.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 13 Nov 2008 05:32:43 +0000 (22:32 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 13 Nov 2008 05:32:43 +0000 (22:32 -0700)
imp/lib/Mime/Viewer/alternative.php

index 9bf5156..490b443 100644 (file)
@@ -85,12 +85,14 @@ class IMP_Horde_Mime_Viewer_alternative extends Horde_Mime_Viewer_Driver
         }
 
         /* Now grab all keys under this ID. */
+        $display_ids = array_flip($display_ids);
         $render_part = $this->_mimepart->getPart($disp_id);
         foreach (array_keys($render_part->contentTypeMap()) as $val) {
-            if (in_array($val, $display_ids) && !isset($ret[$val])) {
+            if (isset($display_ids[$val])) {
                 $render = $this->_params['contents']->renderMIMEPart($val, 'inline', array('params' => $this->_params));
                 foreach (array_keys($render) as $id) {
                     $ret[$id] = $render[$id];
+                    unset($display_ids[$id]);
                 }
             }
         }