Req #39469 [Com]: FILTER_VALIDATE_EMAIL does not accept IDN domain names

From: Date: Fri, 20 Mar 2015 01:46:10 +0000
Subject: Req #39469 [Com]: FILTER_VALIDATE_EMAIL does not accept IDN domain names
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191476@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=39469&edit=1

 ID:                 39469
 Comment by:         ppaisndud at gmail dot com
 Reported by:        christoph at ziegenberg dot de
 Summary:            FILTER_VALIDATE_EMAIL does not accept IDN domain
                     names
 Status:             Re-Opened
 Type:               Feature/Change Request
 Package:            Filter related
 Operating System:   WinXP SP2
 PHP Version:        5.2.0
 Block user comment: N
 Private report:     N

 New Comment:

Similar to https://bugs.php.net/bug.php?id=65027
which suggests to use idn_to_ascii from pecl intl 

http://3v4l.org/THEZj


Previous Comments:
------------------------------------------------------------------------
[2014-07-19 18:33:59] pajoye@php.net

For the record, it never aimed to support punycode. One has to convert them first.

------------------------------------------------------------------------
[2014-07-15 16:46:59] drogolov at gmail dot com

Any news? Still not fixed.

------------------------------------------------------------------------
[2013-03-04 14:42:50] dean at deansas dot org

This doesn't seem to be fixed. Please reopen.

dean@ernie:~$ php -r "var_dump(filter_var('fred@bücher.ch', 
FILTER_VALIDATE_EMAIL));"
bool(false)


Using:
PHP 5.3.10-1ubuntu3.5 with Suhosin-Patch (cli) (built: Jan 18 2013 23:40:19) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

------------------------------------------------------------------------
[2010-09-27 05:13:24] aharvey@php.net

This has since been fixed, and works in the current 5.2 and 5.3 releases.

------------------------------------------------------------------------
[2006-11-11 11:19:54] christoph at ziegenberg dot de

Description:
------------
The filter FILTER_VALIDATE_EMAIL does not accept IDN domain names, so valid email addresses are not
accepted, the punycode version works.

I know the check for this is a little bit complex, because the allowed chars in the domain name
depend on the TLD. 

I think the current behavior is okay as default, but there should be an option to allow IDN domain
names.

Reproduce code:
---------------
<?php
var_dump(filter_var('test@tätärätää.de', FILTER_VALIDATE_EMAIL));
var_dump(filter_var('test@xn--ttrt-loabbba.de', FILTER_VALIDATE_EMAIL));
?>

Expected result:
----------------
string(...) "..."
string(...) "..."

Actual result:
--------------
bool(false)
string(...) "..."


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=39469&edit=1


Thread (9 messages)

« previous php.bugs (#191476) next »