Make WordPress Core

Opened 15 years ago

Closed 14 years ago

#18463 closed defect (bug) (fixed)

wp_mail() does not allow"<address@tld.com>", regression

Reported by: kitchin's profile kitchin Owned by: westi's profile westi
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Mail Keywords: has-patch westi-likes
Focuses: Cc:

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)

18463.patch (1.9 KB) - added by SergeyBiryukov 15 years ago.

Download all attachments as: .zip

Change History (10)

#1 @pavelevap
15 years ago

  • Cc pavelevap@… added

Thank you for creating this ticket...

#2 @SergeyBiryukov
15 years ago

  • Keywords has-patch added

#3 follow-up: @westi
15 years ago

  • Keywords westi-likes added
  • Milestone changed from Awaiting Review to 3.3
  • Owner set to westi
  • Status changed from new to accepted

#4 @jane
14 years ago

  • Component changed from General to Mail

#5 @SergeyBiryukov
14 years ago

  • Component changed from Mail to General
  • Keywords needs-unit-tests added; needs-codex removed

#6 @SergeyBiryukov
14 years ago

  • Component changed from General to Mail

#7 in reply to: ↑ 3 @westi
14 years ago

  • Keywords needs-unit-tests removed

#8 @westi
14 years ago

I think we can probably remove the trims rather than adding more.

#9 @westi
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In [18717]:

Improve the parsing of email addresses in wp_mail to re-support RFC2822 nameless "<address@…>" style. Fixes #18463 props kitchin and SergeyBiryukov.

Note: See TracTickets for help on using tickets.