|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-11 11:19 UTC] 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(...) "..."
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
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