Edit report at http://bugs.php.net/bug.php?id=53395&edit=1
ID: 53395 Updated by: [email protected] Reported by: edanpr at gmail dot com Summary: FILTER_VALIDATE_EMAIL return false on valid emails -Status: Open +Status: Bogus Type: Bug -Package: Unknown/Other Function +Package: Filter related Operating System: debian PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: filter_var() is right in both cases here: domain names can only include consecutive hyphens when being used for internationalised domains (which implies that the name is of the form xn--XXX), and the local part of an e-mail address can't include consecutive dots, per the grammar in RFC 5322. Previous Comments: ------------------------------------------------------------------------ [2010-11-24 12:58:10] edanpr at gmail dot com Description: ------------ In php 5.3.3 using filter_var to validate email (FILTER_VALIDATE_EMAIL) that got more than one period (.) or dash (-) results in error while in 5.3.2 it didn't. [email protected] will return false on 5.3.3 and true on 5.3.2 [email protected] will return false on 5.3.3 and true on 5.3.2 Test script: --------------- <? $adr1 = '[email protected]'; $adr2 = '[email protected]'; var_dump(filter_var($adr1, FILTER_VALIDATE_EMAIL)); var_dump(filter_var($adr2, FILTER_VALIDATE_EMAIL)); Expected result: ---------------- string(15) "[email protected]" string(13) "[email protected]" Actual result: -------------- bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53395&edit=1
