|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70792 FILTER_VALIDATE_EMAIL have limit for 64 characters on the user part
Submitted: 2015-10-26 14:16 UTC Modified: 2015-10-26 19:17 UTC
From: nadavvin at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.6.14 OS: windows
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: nadavvin at gmail dot com
New email:
PHP Version: OS:


 [2015-10-26 14:16 UTC] nadavvin at gmail dot com
filter_var with FILTER_VALIDATE_EMAIL failed when user part of email is longer than 64 characters.

Test script:
php -r "echo filter_var('', FILTER_VALIDATE_EMAIL) ? 'True' : 'False';"

php -r "echo filter_var('', FILTER_VALIDATE_EMAIL) ? 'True' : 'False';"

Expected result:


Actual result:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-26 16:35 UTC] php at sogetthis dot com
RFC5321 The maximum total length of a user name or other local-part is 64 octets.
 [2015-10-26 19:17 UTC]
-Status: Open +Status: Not a bug
 [2015-10-26 19:17 UTC]
 [2015-10-27 05:38 UTC] a at b dot c dot de
"Every implementation MUST be able to receive objects of at least these sizes. .... To the maximum extent possible, implementation techniques that impose no limits on the length of these objects should be used."

In other words, just because you _can_ impose the restriction, doesn't mean you _should_.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 18:01:28 2023 UTC