Re: Sanitize filters
| From: | Rowan Tommins | Date: | Thu, 06 Oct 2022 20:05:26 +0000 |
| Subject: | Re: Sanitize filters | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118770@lists.php.net to get a copy of this message | ||
On 06/10/2022 14:44, Claude Pache wrote:
While it may be difficult to validate an email according to some IETF’s RFC, the HTML standard has pragmatically adopted a pattern (used to validate <input type=email> fields) that is both readable and suitable for most practical purposes. See:
https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address
Well, it would be a more clearly documented source than the current implementation, although the spec admits it's "wilfully" not following e-mail standards. I'd be happy to see it committed, maybe for PHP 8.3.
I note that it doesn't support internationalized addresses in their Unicode form, though, so it won't do for FILTER_FLAG_EMAIL_UNICODE.
Regards,
--
Rowan Tommins
[IMSoP]