Skip to content

Conversation

@mattyrob
Copy link
Collaborator

Description

This improves how wp_mail() handles Content-Type headers for multipart messages, preventing cases where the header could be duplicated.

Motivation and context

Backport and fixes potential header duplication.

How has this been tested?

Unit test included and fixed for ClassicPress.

Screenshots

N/A

Types of changes

  • Bug fix

westonruter and others added 2 commits November 12, 2025 16:07
This improves how `wp_mail()` handles `Content-Type` headers for multipart messages, preventing cases where the header could be duplicated.

Developed in WordPress/wordpress-develop#9500

WP:Props SirLouen, gitlost, rmccue, westi, MattyRob, bgermann, nacin, SergeyBiryukov, dd32, MikeHansenMe, Kleor, kitchin, JeffMatson, abcd95, westonruter, christinecooper, JohnVieth, dawidadach, imokweb, ayeshrajans, lakshyajeet, tusharbharti, sajjad67.
Fixes https://core.trac.wordpress.org/ticket/15448.

---

Merges https://core.trac.wordpress.org/changeset/61201 / WordPress/wordpress-develop@024bbfcc4c to ClassicPress.
Changed the type hint from WP_PHPMailer to MockPHPMailer in the $set_alt_body callback within the wpMail test. This ensures the callback matches the actual mock object used in the test environment.
@mattyrob mattyrob added this to the 2.6 milestone Nov 12, 2025
Copy link
Member

@xxsimoxx xxsimoxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before:

Content-Type: =?us-ascii?Q?multipart/alternative;_boundary=3D"----=3D=5FPa?=
 =?us-ascii?Q?rt=5F18243133=5F1346573420.1408991447668"?=
MIME-Version: 1.0
Content-Type: multipart/alternative; charset=

After:

MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_18243133_1346573420.1408991447668"; charset=

@mattyrob mattyrob merged commit 6593543 into develop Nov 16, 2025
44 checks passed
@mattyrob mattyrob deleted the merge/wp-r61201 branch November 16, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants