fixed infinit recursion in multipart message containing other multipart

This commit is contained in:
Ralf Becker 2013-11-19 13:18:30 +00:00
parent 8a38b817d0
commit 762f0f5c8a

View File

@ -3221,12 +3221,17 @@ class mail_bo
$partText = $partHTML = null; $partText = $partHTML = null;
if (self::$debug) _debug_array(array("METHOD"=>__METHOD__,"LINE"=>__LINE__,"STRUCTURE"=>$_structure)); if (self::$debug) _debug_array(array("METHOD"=>__METHOD__,"LINE"=>__LINE__,"STRUCTURE"=>$_structure));
$ignore_first_part = true;
foreach($_structure->contentTypeMap() as $mime_id => $mime_type) foreach($_structure->contentTypeMap() as $mime_id => $mime_type)
{ {
//error_log(__METHOD__."($_uid, ".$_structure->getMimeId().") $mime_id: $mime_type"); //error_log(__METHOD__."($_uid, ".$_structure->getMimeId().") $mime_id: $mime_type");
if (self::$debug) echo __METHOD__."($_uid, partID=".$_structure->getMimeId().") $mime_id: $mime_type<br>"; if (self::$debug) echo __METHOD__."($_uid, partID=".$_structure->getMimeId().") $mime_id: $mime_type<br>";
if (!$mime_id) continue; // ignore multipart/alternative itself if ($ignore_first_part)
{
$ignore_first_part = false;
continue; // ignore multipart/alternative itself
}
$mimePart = $_structure->getPart($mime_id); $mimePart = $_structure->getPart($mime_id);
@ -3340,12 +3345,17 @@ class mail_bo
$bodyPart = array(); $bodyPart = array();
if (self::$debug) _debug_array($_structure); if (self::$debug) _debug_array($_structure);
$ignore_first_part = true;
foreach($_structure->contentTypeMap() as $mime_id => $mime_type) foreach($_structure->contentTypeMap() as $mime_id => $mime_type)
{ {
//error_log(__METHOD__."($_uid, ".$_structure->getMimeId().") $mime_id: $mime_type"); //error_log(__METHOD__."($_uid, ".$_structure->getMimeId().") $mime_id: $mime_type");
if (self::$debug) echo __METHOD__."($_uid, partID=".$_structure->getMimeId().") $mime_id: $mime_type<br>"; if (self::$debug) echo __METHOD__."($_uid, partID=".$_structure->getMimeId().") $mime_id: $mime_type<br>";
if (!$mime_id) continue; // ignore multipart/mixed itself if ($ignore_first_part)
{
$ignore_first_part = false;
continue; // ignore multipart/mixed itself
}
$part = $_structure->getPart($mime_id); $part = $_structure->getPart($mime_id);
@ -3355,8 +3365,7 @@ class mail_bo
switch($part->getSubType()) switch($part->getSubType())
{ {
case 'alternative': case 'alternative':
$bodyPart[] = $this->getMultipartAlternative($_uid, $part, $_htmlMode, $_preserveSeen); return array($this->getMultipartAlternative($_uid, $part, $_htmlMode, $_preserveSeen));
break;
case 'mixed': case 'mixed':
case 'signed': case 'signed':