ID: 47282 Updated by: [email protected] Reported By: jachin at clockwork dot net -Status: Verified +Status: Closed Bug Type: Filter related Operating System: * PHP Version: 5.*,6 CVS-2009-02-02 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-02-02 23:18:41] [email protected] Note: the expected = actual result and actual = expected in above report. ------------------------------------------------------------------------ [2009-02-02 21:56:18] jachin at clockwork dot net Description: ------------ I tried to refractor email validation code to use the FILTER_VALIDATE_EMAIL filter instead of a regex. Our Unit tests failed, because it marked the following email addresses as invalid: [email protected] a...@com Reproduce code: --------------- <?php $wacky_but_valid_emails[] = '[email protected]'; $wacky_but_valid_emails[] = 'a...@com'; foreach( $wacky_but_valid_emails as $email ) { print "$email : "; $result = filter_var($email, FILTER_VALIDATE_EMAIL ); var_dump($result); } ?> Expected result: ---------------- [email protected] : bool(false) a...@com : bool(false) Actual result: -------------- [email protected] : string([email protected]) a...@com : string(a...@com) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47282&edit=1
