php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66553 FILTER_VALIDATE_EMAIL does not accept user@host addresses
Submitted: 2014-01-22 18:22 UTC Modified: 2016-11-21 17:28 UTC
Votes:3
Avg. Score:3.0 ± 1.4
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: dregad at mantisbt dot org Assigned: cmb (profile)
Status: Closed Package: Filter related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
7 + 46 = ?
Subscribe to this entry?

 
 [2014-01-22 18:22 UTC] dregad at mantisbt dot org
Description:
------------
---
From manual page: http://www.php.net/filter.filters.validate
---
It would be nice to document here the fact that FILTER_VALIDATE_EMAIL will reject addresses like 'user@host', despite the fact that they are valid as per RFC5322

See the discussion in https://bugs.php.net/bug.php?id=49576 (especially the last 4 entries)



Test script:
---------------
var_dump(filter_var('user@host', FILTER_VALIDATE_EMAIL ));



Expected result:
----------------
string(9) "user@host"

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-15 10:01 UTC] daniel dot wendler dot hamburg at gmail dot com
Will this be fixed or will there be a FILTER FLAG to distinct between localhost / localnet mail addresses and public ones ?
 [2016-11-21 17:04 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: Documentation problem +Package: Filter related -Assigned To: +Assigned To: cmb
 [2016-11-21 17:04 UTC] cmb@php.net
> Will this be fixed or will there be a FILTER FLAG to distinct
> between localhost / localnet mail addresses and public ones ?

For now, I'm going to fix the documentation. Adding a new flag is
left for request #69140.
 [2016-11-21 17:28 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=341094
Log: Fix #66553: FILTER_VALIDATE_EMAIL does not accept user@host addresses
 [2016-11-21 17:28 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-11-21 17:28 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:06 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=6d0118397d13d30db4e6021fd02497705d639ed0
Log: Fix #66553: FILTER_VALIDATE_EMAIL does not accept user@host addresses
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 00:01:28 2024 UTC