Edit report at http://bugs.php.net/bug.php?id=53722&edit=1
ID: 53722 User updated by: romain dot riviere at gmail dot com Reported by: romain dot riviere at gmail dot com Summary: FILTER_VALIDATE_EMAIL fails on numeric TLDs Status: Bogus Type: Bug Package: Filter related Operating System: Linux PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Precisely. FILTER_VALIDATE_EMAIL should validate *technically* correct email addresses, not just ICANN-correct ones. It is already the case for .foo or .bar TLDs, it just needs to do the same for numeric TLDs, because from a technical point of view, there are no different: old restrictions in old RFCs have all been superseded now. Previous Comments: ------------------------------------------------------------------------ [2011-02-13 23:30:16] frank9321 at gmail dot com I think that Romain in right. There are numeric TLDs (like the .42 TLD wich is taking off), and sometimes, as Romain said, you use such TLDs in your LAN. So, really, the FILTER_VALIDATE_EMAIL should accept numeric TLDs. It isn't because the ICANN said that there couldn't be numeric TLDs that there aren't. ------------------------------------------------------------------------ [2011-01-18 14:15:16] romain dot riviere at gmail dot com There ARE numeric TLDs, even though they are not made public. I have one on my LAN. The filter should probably not rely on what is believed to exist, but on what is technically feasible. In other words, if I can get email on the address johndoe@domain.123 (and again, YES, it works), then FILTER_VALIDATE_EMAIL should not reject such an address. ------------------------------------------------------------------------ [2011-01-18 14:03:15] il...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php There are no numeric TLDs, the e-mail filters supports IP based e-mail addresses however. ------------------------------------------------------------------------ [2011-01-12 13:48:58] romain dot riviere at gmail dot com Description: ------------ Although FILTER_VALIDATE_EMAIL accepts non-existent TLDs, it refuses to validate numeric TLDs. AFAIK, there is no technical justification for this: numeric TLDs just work out of the box as far as the DNS know about them. I suggest that the filter should validate numeric TLDs, or that a FILTER_FLAG_ALLOW_NUMTLD be created to alter the default behaviour of the filter. Test script: --------------- filter_var("johndoe@domain.123", FILTER_SANITIZE_EMAIL) ; // returns false ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53722&edit=1