[wp-trac] [WordPress Trac] #53130: is_email() and sanitize_email() differ.
WordPress Trac
noreply at wordpress.org
Sun May 2 12:11:36 UTC 2021
#53130: is_email() and sanitize_email() differ.
----------------------------+------------------------------
Reporter: DuisterDenHaag | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: 5.5
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
----------------------------+------------------------------
Description changed by SergeyBiryukov:
Old description:
> According to `sanitize_email()` and `FILTER_SANITIZE_EMAIL` and
> `FILTER_VALIDATE_EMAIL` a plus sign (+) is a valid character in an email
> address. Yet `is_email()` will fail. (`info+admin at example.com`)
>
> Why is the validity for `is_email()` different from `sanitize_email()`?
>
> Before reporting this, I found two related issues:
> https://core.trac.wordpress.org/ticket/47467 and
> https://core.trac.wordpress.org/changeset/48645
>
> Since PHPMailer is using is_email() all valid addresses with a + will
> result in an error.
New description:
According to `sanitize_email()` and `FILTER_SANITIZE_EMAIL` and
`FILTER_VALIDATE_EMAIL` a plus sign (+) is a valid character in an email
address. Yet `is_email()` will fail. (`info+admin at example.com`)
Why is the validity for `is_email()` different from `sanitize_email()`?
Before reporting this, I found two related issues: #47467 and [48645].
Since PHPMailer is using is_email() all valid addresses with a + will
result in an error.
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53130#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list