|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61012 filter_var don't pass valid email address
Submitted: 2012-02-08 14:58 UTC Modified: 2012-02-09 08:43 UTC
From: sucotronic at gmail dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.3SVN-2012-02-08 (snap) OS: linux ubuntu 10.04
Private report: No CVE-ID: None
 [2012-02-08 14:58 UTC] sucotronic at gmail dot com
If you use the filter_var function to test an email address, and the address 
starts with the '+' sign, it's marked as invalid, but it isn't.

Test script:

Expected result:
Return the string and not false.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-08 16:49 UTC]
-Status: Open +Status: Not a bug
 [2012-02-08 16:49 UTC]
Unable to reproduce in 5.3/5.4:

php > echo filter_var("", FILTER_VALIDATE_EMAIL);

Make sure you are actually trying this in 5.3. This may have been broken in 5.2, 
but was fixed years ago in 5.3.
 [2012-02-08 17:55 UTC] sucotronic at gmail dot com
More exactly, my version is: 5.3.2-1ubuntu4.11
 [2012-02-08 18:12 UTC] anon at anon dot anon
I also get false, using PHP 5.3.2/Windows.

But according to the change log, FILTER_VALIDATE_EMAIL was overhauled in PHP 5.3.3, in July 2010, after this bug report:
 [2012-02-08 18:58 UTC]
Yes, this was fixed in July 2010 in 5.3.3.
 [2012-02-09 08:43 UTC] sucotronic at gmail dot com
Ok, I found it at: fixed in 5.3.3 release 
and open a bug in ubuntu to request to update it 
( Thanks for help.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 12:01:32 2024 UTC