Bump imapengine from 1.25.4 to 1.25.6 and dependencies

This commit is contained in:
johnnyq
2026-08-26 13:02:29 -04:00
parent 71cfdf5e39
commit 3d9a41bec4
54 changed files with 978 additions and 543 deletions

View File

@@ -482,6 +482,7 @@ class Email extends Message
}
$otherParts = $relatedParts = [];
$cidReplacements = [];
foreach ($this->attachments as $part) {
foreach ($names as $name) {
if ($name !== $part->getName() && (!$part->hasContentId() || $name !== $part->getContentId())) {
@@ -491,9 +492,7 @@ class Email extends Message
continue 2;
}
if ($name !== $part->getContentId()) {
$html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html);
}
$cidReplacements['cid:'.$name] = 'cid:'.$part->getContentId();
$relatedParts[$name] = $part;
$part->setName($part->getName() ?? $part->getContentId())->asInline();
@@ -502,6 +501,11 @@ class Email extends Message
$otherParts[] = $part;
}
if ($cidReplacements) {
// all references are replaced at once as strtr() matches the longest name first and
// never replaces inside already substituted text, unlike successive str_replace() calls
$html = strtr($html, $cidReplacements);
}
if (null !== $htmlPart) {
$htmlPart = new TextPart($html, $this->htmlCharset, 'html');
}