bug #39980 [Mailer][Mime] Update inline part names with newly generated ContentId (ddegentesh)

This PR was submitted for the 5.2 branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

[Mailer][Mime] Update inline part names with newly generated ContentId

Inline parts are identified by matching attachment names to cids found in the html part. In line 487 cids are regenerated and replaced in the html part, but the attachment names were not similarly replaced.

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

Commits
-------

eb14a1e1f0 [Mailer][Mime] Update inline part names with newly generated ContentId
This commit is contained in:
Fabien Potencier 2021-02-05 09:16:59 +01:00
commit 2d2653042a
1 changed files with 1 additions and 0 deletions

View File

@ -491,6 +491,7 @@ class Email extends Message
$attachment['inline'] = true;
$inlineParts[$name] = $part = $this->createDataPart($attachment);
$html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html);
$part->setName($part->getContentId());
continue 2;
}
$attachmentParts[] = $this->createDataPart($attachment);