Edit report at https://bugs.php.net/bug.php?id=54233&edit=1

 ID:                 54233
 Comment by:         michael at squiloople dot com
 Reported by:        flood at itnews-bg dot com
 Summary:            PHP Filter email doesn't work properly
 Status:             Open
 Type:               Bug
 Package:            Filter related
 Operating System:   Slackware 13x86_64
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

That is a valid email address. "?", "'" and "_", ".", as well as letters and 
numbers are acceptable characters in an email address's local-part.

carsten_sttgt at gmx dot de, it uses RFC 5321 (more or less).


Previous Comments:
------------------------------------------------------------------------
[2011-03-12 12:14:02] carsten_sttgt at gmx dot de

That's the correct behavior.
FILTER_SANITIZE_EMAIL on:
?“?‰?“a‚¬?“?S?“a‚¬_?“a€??“a€¦?“??' 
this.is.a.test...@email.com

results in:
???a??S?a_?a??a???'this.is.a.test...@email.com

and that's a valid email address according to (at least) RFC822
(sorry, don't know which RFC PHP is exactly using for FILTER_VALIDATE_EMAIL. 
Should be documented)

------------------------------------------------------------------------
[2011-03-11 22:44:21] flood at itnews-bg dot com

Hey,

It seems the filter function is not working some times.
You can see in the test script that the email is returned as a valid though 
it's not quite.

------------------------------------------------------------------------
[2011-03-11 22:43:36] flood at itnews-bg dot com

Description:
------------
Hey,

It seems the filter function is not working some times.
You can see in the test script that the email is returned as a valid though 
it's not quite.

Testing script:
<?php

$email = "?“?‰?“a‚¬?“?S?“a‚¬_?“a€??“a€¦?“??' 
this.is.a.test...@email.com";
var_dump(filter_var(filter_var($email,FILTER_SANITIZE_EMAIL), 
FILTER_VALIDATE_EMAIL));

?>



Test script:
---------------
<?php

$email = "?“?‰?“a‚¬?“?S?“a‚¬_?“a€??“a€¦?“??' 
this.is.a.test...@email.com";
var_dump(filter_var(filter_var($email,FILTER_SANITIZE_EMAIL), 
FILTER_VALIDATE_EMAIL));

?>

Expected result:
----------------
It should return a false boolean. This is not a valid email.

Actual result:
--------------
Returns an invalid email:
???a??S?a_?a??a???'this.is.a.test...@email.com




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



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

Reply via email to