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

From: Date: Tue, 15 Jul 2014 16:47:00 +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-186640@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:         drogolov at gmail dot com
 Reported by:        christoph at ziegenberg dot de
 Summary:            FILTER_VALIDATE_EMAIL does not accept IDN domain
                     names
 Status:             Closed
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   WinXP SP2
 PHP Version:        5.2.0
 Assigned To:        aharvey
 Block user comment: N
 Private report:     N

 New Comment:

Any news? Still not fixed.


Previous Comments:
------------------------------------------------------------------------
[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 (#186640) next »