php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55865 email cyrillic symbols contains are not valid at filter_var function
Submitted: 2011-10-07 15:02 UTC Modified: -
Votes:7
Avg. Score:4.9 ± 0.3
Reproduced:5 of 6 (83.3%)
Same Version:3 (60.0%)
Same OS:3 (60.0%)
From: mitallast at gmail dot com Assigned:
Status: Open Package: *Mail Related
PHP Version: 5.3.8 OS: nix*, mac
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-10-07 15:02 UTC] mitallast at gmail dot com
Description:
------------
Php contains filter_var function with predefined constaint FILTER_VALIDATE_EMAIL.
This function incorrect validate email with cyrrilic symbols.
Error can be at file "ext/filter/logical_filters.c" at function "void 
php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL)"

Test script:
---------------
<?php
$value = "тест@тест.рф";
var_dump(filter_var($value, FILTER_VALIDATE_EMAIL));

Expected result:
----------------
(boolean)true

Actual result:
--------------
(boolean)false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-25 09:03 UTC] enderstd at gmail dot com
I think this behaviour is all right. There is a punycode form for IDN domains, 
and 
filter_var undestands it well enough, yet not without some issues. But I think 
punycode is way to go.

http://en.wikipedia.org/wiki/Punycode

And by the way, "тест@тест.рф" is invalid email anyway, because mailbox can't 
contain IDN characters, I think it violates some basic SMTP RFC. Valid domain 
would be like "test@тест.рф".
 [2012-07-15 00:00 UTC] doomasmile at gmail dot com
Signed.

Function must be refactored.
http://en.wikipedia.org/wiki/.%D1%80%D1%84
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 19:01:51 2014 UTC