|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55008 PHP Filter email doesn't work for facebook emails
Submitted: 2011-06-07 16:25 UTC Modified: 2011-06-07 17:52 UTC
From: zedorg at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3.6 OS: x86_64 GNU/Linux
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: zedorg at gmail dot com
New email:
PHP Version: OS:


 [2011-06-07 16:25 UTC] zedorg at gmail dot com

it seems the filter function is not working the "new" facebook emails like: where x is an alpha numeric character. It returns false.

This new feature comes from 2010 January, see:

We got a lot of validation failures, cause of this, from facebook connected users, when we trying to use filter_var on these emails.

A bit strange, cause if I change the "apps+xxxxxxxxxxxxxxx" to "apps+xxxxxxxxxx", 5 letter shorted, it accepts. However this won't help us :)

Test script:

var_dump(filter_var("", FILTER_VALIDATE_EMAIL));

Expected result:
It should return the given email address.

Actual result:
Returns false.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-07 16:29 UTC] zedorg at gmail dot com
Checked rfc, if this is the good one , and it says "The maximum total length of a user name or other local-part is 64 octets."
However facebook uses 70?
 [2011-06-07 17:52 UTC]
-Status: Open +Status: Bogus
 [2011-06-07 17:52 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The filter extension uses a regular expression based on RFC 5321, which like you 
found, says that the limit on a local-part of an e-mail is 64 octets. 

 [2011-06-08 17:09 UTC] zedorg at gmail dot com
Just for who has the similar problem: facebook accepts these emails without the "apps+" prefix, so this can be cut from email and then its rfc compliant again.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 23 01:01:23 2023 UTC