Opened 21 months ago
Closed 20 months ago
#18463 closed defect (bug) (fixed)
wp_mail() does not allow"<address@tld.com>", regression
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | Version: | 3.2.1 | |
| Severity: | normal | Keywords: | has-patch westi-likes |
| Cc: | pavelevap@… |
Description
This regression was caused by Ticket #17305: wp_mail() does not accommodate address format "Name <address@…>".
The format "<address@…>" no longer works, it has to be "address@…". In Ticket #17305 Comment 12 commenter Pavelevap says this is a regression.
I explained already in Ticket #17305 Comment 11 why the new regex is not optimal (greediness), and I provided a new regex:
patch was: '/(.+)\s?<(.+)>/'
should be: '/(.*)<(.+)>/'
I called it an enhancement, because the new regex would make "<address@…>" work without a "Name" in front. But it seems actually to fix a regression.
For belt-and-suspenders, trim() can be applied to the results, as it is now, though the call to AddAnAddress() actually does the trim() anyway.
Attachments (1)
Change History (10)
SergeyBiryukov — 21 months ago
comment:2
SergeyBiryukov — 21 months ago
- Keywords has-patch added
- Keywords westi-likes added
- Milestone changed from Awaiting Review to 3.3
- Owner set to westi
- Status changed from new to accepted
We need to add some test cases for this here too - http://unit-tests.trac.wordpress.org/browser/wp-testcase/test_includes_pluggable.php#L144
comment:5
SergeyBiryukov — 20 months ago
- Component changed from Mail to General
- Keywords needs-unit-tests added; needs-codex removed
comment:6
SergeyBiryukov — 20 months ago
- Component changed from General to Mail
- Keywords needs-unit-tests removed
Replying to westi:
We need to add some test cases for this here too - http://unit-tests.trac.wordpress.org/browser/wp-testcase/test_includes_pluggable.php#L144

Thank you for creating this ticket...