php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48042 FILTER_VALIDATE_EMAIL error
Submitted: 2009-04-22 10:00 UTC Modified: 2009-04-27 07:35 UTC
From: m dot vdhulst at puredutch dot nl Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.9 OS: xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: m dot vdhulst at puredutch dot nl
New email:
PHP Version: OS:

 

 [2009-04-22 10:00 UTC] m dot vdhulst at puredutch dot nl
Description:
------------
Some email addresses that are obviously wrong, pass the validation with
FILTER_VALIDATE_EMAIL.  You can not have a top level domain with one
character only.

as reported in bugreport http://bugs.php.net/bug.php?id=47879 

nice to have the option to:
select whether it has to check if its an internal address or a non internal address.

Reproduce code:
---------------
var_dump(filter_var("x@y.z", FILTER_VALIDATE_EMAIL));


Expected result:
----------------
bool(false)




Actual result:
--------------
string(5) "x@y.z"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-22 10:47 UTC] rasmus@php.net
Did you not read the comment on 47879?  You can have single-letter top-levels in internal mail systems.
 [2009-04-27 07:30 UTC] m dot vdhulst at puredutch dot nl
[UPDATED]

Reproduce code:
---------------
var_dump(filter_var("x@y", FILTER_VALIDATE_EMAIL));

Expected result:
----------------
bool(false)

Actual result:
--------------
string(3) "x@y"

as shown this will result to true, but this is not a valid email adress. 

I would like to see additional flags, f.ex.: FILTER_VALIDATE_EMAIL_INTERNAL, respectively FILTER_VALIDATE_EMAIL_INTERNATIONAL.
 [2009-04-27 07:35 UTC] m dot vdhulst at puredutch dot nl
[UPDATED2]

Maybe my description is a bit wrong. I would like to have additional validation flags like FILTER_FLAG_EMAIL_INTERNAL, FILTER_FLAG_EMAIL_INTERNATIONAL so that the filter can also be used to check against only international email adresses (with a dot after de @).

(sorry about the noise, I tried to edit my original bug description, but this doesn't work. Neither can i re-open the feature request)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC