mirror of
https://github.com/itflow-org/itflow
synced 2026-09-21 22:21:15 +00:00
Bump imapengine from 1.25.4 to 1.25.6 and dependencies
This commit is contained in:
10
libs/vendor/symfony/mime/Email.php
vendored
10
libs/vendor/symfony/mime/Email.php
vendored
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user