php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 - 3 = ?
Subscribe to this entry?

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

Test script:
---------------
php -r "echo filter_var('123456789012345678901234567890abcderghjklpoinhyxxxxxxxxxxxxxxxxx@gmailxx.com', FILTER_VALIDATE_EMAIL) ? 'True' : 'False';"

php -r "echo filter_var('123456789012345678901234567890abcderghjklpoinhyxxxxxxxxxxxxxxxxxx@gmail.com', FILTER_VALIDATE_EMAIL) ? 'True' : 'False';"

Expected result:
----------------
True

True

Actual result:
--------------
True

False

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-26 16:35 UTC] php at sogetthis dot com
RFC5321 4.5.3.1.1: The maximum total length of a user name or other local-part is 64 octets.
 [2015-10-26 19:17 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2015-10-26 19:17 UTC] requinix@php.net
That.
 [2015-10-27 05:38 UTC] a at b dot c dot de
RFC 4.5.3.1
"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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 15:01:28 2024 UTC