Req #65027 [Dup]: FILTER_VALIDATE_EMAIL does not accept IDN domain names
| From: | cmb@php.net | Date: | Mon, 21 Nov 2016 15:22:47 +0000 |
| Subject: | Req #65027 [Dup]: FILTER_VALIDATE_EMAIL does not accept IDN domain names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205518@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65027&edit=1
ID: 65027
Updated by: cmb@php.net
Reported by: info at iwebsoft dot de
Summary: FILTER_VALIDATE_EMAIL does not accept IDN domain
names
Status: Duplicate
Type: Feature/Change Request
Package: Filter related
Operating System: PHP 5.3.10-1ubuntu3.6 with Suhos
PHP Version: 5.5.0RC3
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> An easy workaround is to just call idn_to_ascii() on the address
> you pass to the filter.
FTR: while this may be sufficient as workaround for the
validation, the result of filter_var() would not be the desired
email address.
Previous Comments:
------------------------------------------------------------------------
[2015-06-15 23:16:40] cmb@php.net
Actually, this is not a bug, because the documentation[1] states:
| In general, this validates e-mail addresses against the syntax
| in RFC 822, [...]
However, IDNs are not allowed by RFC 822. Therefore I'm switching
to feature request, and marking this ticket as duplicate of
request #39469.
[1] <http://php.net/manual/en/filter.filters.validate.php>
------------------------------------------------------------------------
[2013-06-13 14:27:11] rasmus@php.net
An easy workaround is to just call idn_to_ascii() on the address you pass to the
filter.
------------------------------------------------------------------------
[2013-06-13 09:24:28] info at iwebsoft dot de
Description:
------------
The filter FILTER_VALIDATE_EMAIL does not accept IDN domain names, so valid email addresses are not
accepted.
Test script:
---------------
var_dump(filter_var('test@täst.de', FILTER_VALIDATE_EMAIL));
Expected result:
----------------
string(13) "test@täst.de"
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65027&edit=1