ID:               47598
 Updated by:       il...@php.net
 Reported By:      mikael at bluemist dot se
-Status:           Assigned
+Status:           Closed
 Bug Type:         Filter related
 Operating System: Gentoo & Slackware
 PHP Version:      5.2.9
 Assigned To:      iliaa
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2009-03-08 13:55:27] mikael at bluemist dot se

After reading the RFC I realized characters like å ä ö (hex e5 e4 f6)
are not allowed (at least not unquoted). So the expected result should
be:
bool(false)
bool(false)

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

[2009-03-08 13:25:00] mikael at bluemist dot se

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

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

[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