Opened 5 years ago
Last modified 4 years ago
#48951 new feature request
email_too_short is not good email validation candidate
Reported by: | dingo_d | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | low |
Severity: | trivial | Version: | 5.4 |
Component: | Keywords: | 2nd-opinion | |
Focuses: | Cc: |
Description
Currently, both is_email
and sanitize_email
will invalidate/sanitize valid emails:
'admin@mailserver1'
'm@m'
Both are valid emails. ICANN just discourages using them.
The problem comes when you work with decoupled WordPress, and the front end is using custom validation that allows such emails, but WordPress doesn't so you don't have consistent behavior. Plus this is just wrong, as the official specification allows such mails.
https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses
Change History (2)
Note: See
TracTickets for help on using
tickets.
WP runs filters in both
is_email()
andsanitize_email()
. If necessary, you can run a filter on either of these so that if the$context
is 'email_too_short', you returntrue
instead.