[wp-trac] [WordPress Trac] #50720: PHPMailer's validator defaults to 'php' after the upgrade

WordPress Trac noreply at wordpress.org
Wed Jul 22 17:44:57 UTC 2020


#50720: PHPMailer's validator defaults to 'php' after the upgrade
--------------------------+------------------------------
 Reporter:  david.binda   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Mail          |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by Synchro):

 The old validator did allow/deny a few things that were different from
 filter_var – but it's been quite a while since 6 was released and WP is
 late to the party (though at least it's got there!). One thing as I recall
 was that filter_var allowed "dotless" domains (like "a at b") where the PCRE
 pattern did not, because while they're valid in RFCs, they are banned from
 use in email by ICANN. There might be some differences with odd things
 like IPv6 literals.

 I moved away from the big regex mainly because there were persistent
 problems with several versions of PCRE, causing recursion loops, out of
 memory errors. The pattern that lurks behind filter_var was actually
 written by the same person as the one in PHPMailer 5, so it is very
 similar anyway.

 Generally speaking though, neither pattern is likely to reject significant
 numbers of addresses - it's only going to be some very small edge cases
 that are different, and both are large supersets of the HTML5 input tag
 validator (which I also wrote). So it is a BC break, but not one that's
 likely to cause much trouble.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50720#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list