[wp-trac] [WordPress Trac] #17491: Make is_email() compliant with RFC5322 (updated by RFC6854)
WordPress Trac
noreply at wordpress.org
Fri Jul 18 12:20:10 UTC 2025
#17491: Make is_email() compliant with RFC5322 (updated by RFC6854)
-------------------------------------------------+-------------------------
Reporter: arena | Owner: (none)
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: Future
| Release
Component: Formatting | Version: 3.1.2
Severity: minor | Resolution:
Keywords: has-patch dev-feedback needs-unit- | Focuses:
tests is-email |
-------------------------------------------------+-------------------------
Comment (by tusharbharti):
Hi, So I came to this issue while working on RFC Compliance to
`@wordpress/url`'s isEmail and got interested.
As I was working with isEmail, I updated it to support most of the RFC
5322 and used the emails provided by @garrett-eclipse as base to test
this.
If the results seem fine and everybody is on board with the direction, I'm
happy to help port this from JavaScript to PHP, following the code
structure that `is_email()` in WordPress core currently uses. This would
bring the same improved RFC compliance to PHP as well.
Let me know if we proceed with the port or if any feedback on the current
JS implementation needs to be addressed first.
For the IDN domains we can use `Requests_IDNAEncoder` in `is_email()` and
`punycode.js` in `isEmail()`
==== Implementation Results
[[Image(https://i.ibb.co/7x64RNnk/image.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/17491#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list