From 30e7e22596fe382cf8ae4469a60bc4119847de91 Mon Sep 17 00:00:00 2001 From: Pyrol Date: Thu, 18 Jun 2026 00:12:10 +0200 Subject: [PATCH] #710 - fix mails with multiple inline images reposting request: https://github.com/bpali/php-imap/pull/1 after #580 ($contentId || 'inline') replaces every inline image within an email with the first one found. So fix #580 resolution is invalid for that case. --- src/PhpImap/IncomingMail.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/PhpImap/IncomingMail.php b/src/PhpImap/IncomingMail.php index 91ed4571..a7c15518 100644 --- a/src/PhpImap/IncomingMail.php +++ b/src/PhpImap/IncomingMail.php @@ -220,11 +220,8 @@ public function embedImageAttachments(): void $cid = \str_replace('cid:', '', $match); foreach ($attachments as $attachment) { - /** - * Inline images can contain a "Content-Disposition: inline", but only a "Content-ID" is also enough. - * See https://github.com/barbushin/php-imap/issues/569. - */ - if ($attachment->contentId == $cid || 'inline' == \mb_strtolower((string) $attachment->disposition)) { + + if ($attachment->contentId == $cid) { $contents = $attachment->getContents(); $contentType = $attachment->getFileInfo(FILEINFO_MIME_TYPE);