|  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
 [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-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 02 23:05:54 2022 UTC