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
 [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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 15:01:26 2019 UTC