ID:               47598
 User updated by:  mikael at bluemist dot se
 Reported By:      mikael at bluemist dot se
 Status:           Open
 Bug Type:         Filter related
 Operating System: Gentoo & Slackware
 PHP Version:      5.2.9
 New Comment:

Sorry, expected result = actual result and actual = expected.


Previous Comments:
------------------------------------------------------------------------

[2009-03-08 13:22:18] mikael at bluemist dot se

Description:
------------
FILTER_VALIDATE_EMAIL is locale aware and produces different results
depending on the locale set. Or more specific the \w escape sequence
used in the regular expression is locale aware.

>From http://www.php.net/manual/en/regexp.reference.php:
"The definition of letters and digits is controlled by PCRE's character
tables, and may vary if locale-specific matching is taking place. For
example, in the "fr" (French) locale, some character codes greater than
128 are used for accented letters, and these are matched by \w."

Reproduce code:
---------------
setlocale(LC_CTYPE, 'C');
var_dump(filter_var('å�...@example.com', FILTER_VALIDATE_EMAIL));
setlocale(LC_CTYPE, 'sv_SE');
var_dump(filter_var('å�...@example.com', FILTER_VALIDATE_EMAIL));

Expected result:
----------------
bool(false)
string(15) "å�...@example.com"

Actual result:
--------------
string(15) "å�...@example.com"
string(15) "å�...@example.com"


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


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

Reply via email to