Bug #72244 [NEW]: filter_var does not support unicode for local part of emails

From: Date: Thu, 19 May 2016 18:20:37 +0000
Subject: Bug #72244 [NEW]: filter_var does not support unicode for local part of emails
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201202@lists.php.net to get a copy of this message
From: iquito at gmx dot net Operating system: PHP version: 7.0.6 Package: Filter related Bug Type: Bug Bug description:filter_var does not support unicode for local part of emails Description: ------------ filter_var is not up-to-date anymore: the local part of an email address can contain any unicode characters as of RFC 6531, and filter_var should confirm such email addresses as valid. Test script: --------------- filter_var('bücher@example.net', FILTER_VALIDATE_EMAIL); => returns false, even though this is a valid address. It would also be nice to handle UTF8 domains internally (doing a idn_to_ascii on the domain if necessary, just to check the address, not when returning the address), to automatically handle UTF8 in domain names as well as in the local part, because it is not straightforward that you have to pre-process the email address yourself in that way. Validation should be as easy as possible, and doing the idn_to_ascii in filter_var would not have any drawbacks, while the current implementation has a huge drawback in that you have to split up the email address, process the domain, and reconstruct the address just to pass it to filter_var - and you have to know all that & do it correctly. -- Edit bug report at https://bugs.php.net/bug.php?id=72244&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72244&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72244&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72244&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72244&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72244&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72244&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72244&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72244&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72244&r=support Expected behavior: https://bugs.php.net/fix.php?id=72244&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72244&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72244&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72244&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72244&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72244&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72244&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72244&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72244&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72244&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72244&r=mysqlcfg

« previous php.bugs (#201202) next »