try to handle not found image by cid

This commit is contained in:
Klaus Leithoff 2014-02-04 13:37:26 +00:00
parent 2cce4c30c2
commit 247a7f824a

View File

@ -4586,17 +4586,17 @@ class mail_bo
if ($cid == $_cid) if ($cid == $_cid)
{ {
$attachment = $part; $attachment = $part;
break;
} }
// everything else we only consider after we checked all // everything else we only consider after we checked all
if (!isset($attachment)) $attachment = $part; if (!isset($attachment)) $attachment = $part;
}
}
// do we want content fetched, can be done later, if not needed // do we want content fetched, can be done later, if not needed
if (isset($_stream)) if (isset($_stream))
{ {
$this->fetchPartContents($_uid, $attachment, $_stream); $this->fetchPartContents($_uid, $attachment, $_stream);
} }
if (isset($attachment)) break;
}
}
// set name as filename, if not set // set name as filename, if not set
if ($attachment && !$attachment->getDispositionParameter('filename')) if ($attachment && !$attachment->getDispositionParameter('filename'))
{ {
@ -4622,8 +4622,9 @@ class mail_bo
* @param boolean $_preserveSeen flag to preserve the seenflag by using body.peek * @param boolean $_preserveSeen flag to preserve the seenflag by using body.peek
* @return Horde_Mime_Part * @return Horde_Mime_Part
*/ */
public function fetchPartContents($_uid, Horde_Mime_Part $part, $_stream=false, $_preserveSeen=false) public function fetchPartContents($_uid, Horde_Mime_Part $part=null, $_stream=false, $_preserveSeen=false)
{ {
if (is_null($part)) return null;//new Horde_Mime_Part;
$encoding = null; $encoding = null;
// we need to set content on structure to decode transfer encoding // we need to set content on structure to decode transfer encoding
$part->setContents( $part->setContents(