|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Submitted: 2011-03-27 19:29 UTC Modified: 2011-04-11 18:33 UTC
From: mariomaresca at hotmail dot it Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3.6 OS: windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mariomaresca at hotmail dot it
New email:
PHP Version: OS:


 [2011-03-27 19:29 UTC] mariomaresca at hotmail dot it
From manual page:

filter_var with FILTER_VALIDATE_EMAIL takes as good this malformed email:


Test script:
if (filter_var($email, FILTER_VALIDATE_EMAIL))
 echo '$email is good';
 echo '$email is bad';

Expected result:
$email is bad

Actual result:
$email is good


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-29 11:41 UTC]
-Status: Open +Status: Bogus
 [2011-03-29 11:41 UTC]
That's a valid e-mail address: RFC 2822 only requires the local part to be a valid dot-atom, and dot-atom elements may end with a period.
 [2011-03-29 15:18 UTC] tomas dot brastavicius at quantum dot lt
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)

 [2011-03-29 16:28 UTC]
Once the expected/correct behavior is agreed upon, we should also add a test case 
for this. filter's behavior has been inconsistent across the last 10+ releases.
 [2011-03-30 15:29 UTC] carsten_sttgt at gmx dot de
> That's a valid e-mail address: RFC 2822

According to RFC 2822 and this topic FILTER_VALIDATE_EMAIL is working wrong ("" isn't a valid e-mail address, see the answer from Tomas).

FILTER_VALIDATE_EMAIL is working according to RFC2822? In the manual I can't read which rules are used for validating e-mails.
 [2011-04-11 18:25 UTC] tomas dot brastavicius at quantum dot lt
Status of this issue should be changed to Feedback.

We are discussing whether email address is valid as per RFC 2822, but the test script works as expected, i.e. filter_var('', 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 ?
 [2011-04-11 18:33 UTC] mariomaresca at hotmail dot it
Stop saying that's is a valid email.

Try to valid it with Google will say [a-z]. isn't valid in any case.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Mar 04 01:01:29 2024 UTC