From: x2003bruneau Date: Fri, 19 Oct 2007 09:30:29 +0000 (+0000) Subject: Fix rendering of multipart/alternative when it is a subpart X-Git-Tag: 1.8~35 X-Git-Url: http://git.polytechnique.org/?p=banana.git;a=commitdiff_plain;h=350eefb2b4ce7dad0864b9d53bf1e8119c341a87 Fix rendering of multipart/alternative when it is a subpart of another multipart mimepart.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@276 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/mimepart.inc.php b/banana/mimepart.inc.php index 0446640..ed7080f 100644 --- a/banana/mimepart.inc.php +++ b/banana/mimepart.inc.php @@ -433,7 +433,7 @@ class BananaMimePart $signed =& $this->getSignedPart(); if ($signed !== $this) { return $signed->getText(); - } + } $this->decodeContent(); return $this->body; } @@ -452,6 +452,15 @@ class BananaMimePart 'artid' => Banana::$artid, 'part' => $part))) . '" alt="' . banana_htmlentities($this->filename) . '" />'; + } else if ($type == 'multipart' && $subtype == 'alternative') { + $types =& Banana::$msgshow_mimeparts; + foreach ($types as $type) { + @list($type, $subtype) = explode('/', $type); + $part = $this->getParts($type, $subtype); + if (count($part) > 0) { + return $part[0]->toHtml(); + } + } } elseif ((!in_array($type, Banana::$msgshow_mimeparts) && !in_array($this->content_type, Banana::$msgshow_mimeparts)) || $this->disposition == 'attachment') {