From 5026d0ce38b28cdb089bf55acebb588415947086 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 15 Jul 2010 11:23:39 +0000 Subject: [PATCH] fix for cascading Multipart/Alternative --- felamimail/inc/class.bofelamimail.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index 6eb9f57991..1b3eadb5d5 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -1661,7 +1661,7 @@ // as attachment AND as abstracted ical information (we use our notification style here). $partText = false; $partHTML = false; - if (self::$debug) _debug_array($_structure); + if (self::$debug) _debug_array(array("METHOD"=>__METHOD__,"LINE"=>__LINE__,"STRUCTURE"=>$_structure)); foreach($_structure as $mimePart) { if($mimePart->type == 'TEXT' && ($mimePart->subType == 'PLAIN' || $mimePart->subType == 'CALENDAR') && $mimePart->bytes > 0) { if ($mimePart->subType == 'CALENDAR' && $partText === false) $partText = $mimePart; // only if there is no partText set already @@ -1673,6 +1673,9 @@ #$partHTML = array($mimePart); error_log(__METHOD__." process MULTIPART/RELATED with array as subparts"); $partHTML = $mimePart; + } elseif ($mimePart->type == 'MULTIPART' && $mimePart->subType == 'ALTERNATIVE' && is_array($mimePart->subParts)) { + //cascading multipartAlternative structure, assuming only the first one is to be used + return $this->getMultipartAlternative($_uid,$mimePart->subParts,$_htmlMode); } }