|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-03-27 19:29 UTC] mariomaresca at hotmail dot it
Description: ------------ --- From manual page: http://www.php.net/function.filter-var#Description --- filter_var with FILTER_VALIDATE_EMAIL takes as good this malformed email: "mail.@mail.com" Test script: --------------- $email='mail.@mail.com'; if (filter_var($email, FILTER_VALIDATE_EMAIL)) echo '$email is good'; else echo '$email is bad'; Expected result: ---------------- $email is bad Actual result: -------------- $email is good PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 14:00:02 2025 UTC |
It is not correct. Address contains no characters other than atext characters or "." surrounded by atext. dot-atom = [CFWS] dot-atom-text [CFWS] dot-atom-text = 1*atext *("." 1*atext) Reference, http://tools.ietf.org/html/rfc2822#section-3.2.4@aharvey > That's a valid e-mail address: RFC 2822 According to RFC 2822 and this topic FILTER_VALIDATE_EMAIL is working wrong ("mail.@mail.com" isn't a valid e-mail address, see the answer from Tomas). BTW: FILTER_VALIDATE_EMAIL is working according to RFC2822? In the manual I can't read which rules are used for validating e-mails.Status of this issue should be changed to Feedback. We are discussing whether email address mail.@mail.com is valid as per RFC 2822, but the test script works as expected, i.e. filter_var('mail.@mail.com', FILTER_VALIDATE_EMAIL) returns false. I have checked this against 5.3.3 and the latest trunk, both on Linux. Perhaps this is Windows specific bug ?