Req #39469 [ReO]: FILTER_VALIDATE_EMAIL does not accept IDN domain names

From: Date: Sun, 18 Apr 2021 13:56:35 +0000
Subject: Req #39469 [ReO]: FILTER_VALIDATE_EMAIL does not accept IDN domain names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233494@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=39469&edit=1 ID: 39469 Updated by: pollita@php.net Reported by: christoph at ziegenberg dot de Summary: FILTER_VALIDATE_EMAIL does not accept IDN domain names Status: Re-Opened Type: Feature/Change Request Package: Filter related Operating System: WinXP SP2 PHP Version: 5.2.0 Block user comment: N Private report: N New Comment: I just looked inside php_filter_validate_email() for the first time and was horrified to learn we use a regular expression for email validation. https://github.com/php/php-src/blob/master/ext/filter/logical_filters.c#L680 That is broken by design and we need to rip this out. Can confirm that this only works with punycode IDNs, but the fix isn't to shove non-punycode parsing into that monster regex. The fix is to not try to do email validation with a regex. Previous Comments: ------------------------------------------------------------------------ [2021-04-18 10:29:04] cmb@php.net Related To: Bug #80967 ------------------------------------------------------------------------ [2021-04-15 15:37:49] cmb@php.net Related To: Bug #80957 ------------------------------------------------------------------------ [2016-11-21 14:25:18] cmb@php.net Related To: Bug #55865 ------------------------------------------------------------------------ [2016-11-21 14:18:11] cmb@php.net Related To: Bug #72244 ------------------------------------------------------------------------ [2016-08-08 10:05:18] cmb@php.net > For the record, it never aimed to support punycode. One has to > convert them first. Wouldn't it make sense to do the conversion automatically, if ext/intl is available? Otherwise we should mark this as WONTFIX. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=39469 -- Edit this bug report at https://bugs.php.net/bug.php?id=39469&edit=1

« previous php.bugs (#233494) next »