Bug #55008 [Com]: PHP Filter email doesn't work for facebook emails
| From: | zedorg at gmail dot com | Date: | Wed, 08 Jun 2011 15:09:57 +0000 |
| Subject: | Bug #55008 [Com]: PHP Filter email doesn't work for facebook emails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161243@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=55008&edit=1
ID: 55008
Comment by: zedorg at gmail dot com
Reported by: zedorg at gmail dot com
Summary: PHP Filter email doesn't work for facebook emails
Status: Bogus
Type: Bug
Package: Filter related
Operating System: x86_64 GNU/Linux
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2011-06-07 17:52:08] dtajchreber@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
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.
[1] http://lxr.php.net/xref/PHP_5_3/ext/filter/logical_filters.c#499
[2] http://tools.ietf.org/html/rfc5321#section-4.5.3.1
------------------------------------------------------------------------
[2011-06-07 16:29:39] zedorg at gmail dot com
Checked rfc, if this is the good one http://tools.ietf.org/html/rfc5321 , 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 16:25:07] zedorg at gmail dot com
Description:
------------
Hello,
it seems the filter function is not working the "new" facebook emails like:
apps+xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@proxymail.facebook.com where x
is an alpha numeric character. It returns false.
This new feature comes from 2010 January, see: http://www.allfacebook.com/facebook-developers-prepare-to-gain-access-to-user-emails-2010-01
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:
---------------
<?php
var_dump(filter_var("apps+xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@proxymail.facebook.com",
FILTER_VALIDATE_EMAIL));
Expected result:
----------------
It should return the given email address.
Actual result:
--------------
Returns false.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=55008&edit=1