[wp-trac] [WordPress Trac] #31992: Unicode Email Addresses

WordPress Trac noreply at wordpress.org
Fri Apr 17 18:09:13 UTC 2015


#31992: Unicode Email Addresses
--------------------------+------------------------------
 Reporter:  ysalame       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> Tested against trunk (2015-04-16)
>
> '''Test case'''
> {{{
> $target_email = 'dummy-email.y.!#$%@gmail.com';
> echo $target_email.'<br>';
> echo sanitize_email($target_email).'<br>';
> echo 'is_email : '.is_email($target_email);
> }}}
>
> '''Return'''
> {{{
> dummy-email.y.!#$%@gmail.com
> dummy-email.y.!#$%@gmail.com
> is_email : dummy-email.y.!#$%@gmail.com
> }}}
>

> Function is_email @ /wp-includes/formatting.php line 2177
> Preg_replace @ line 2211 is not correct.
> {{{
> if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
> }}}
>
> Function sanitize_email() @ /wp-includes/formatting.php line 2430
> Preg_replace @ line 2460 is not correct.
> {{{
> $local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '',
> $local );
> }}}

New description:

 Tested against trunk (2015-04-16)

 '''Test case'''
 {{{
 $target_email = 'dummy-üñîçøðé.y.!#$%@üñîçøðé.gmail.com';
 echo $target_email.'<br>';
 echo sanitize_email($target_email).'<br>';
 echo 'is_email : '.is_email($target_email);
 }}}

 '''Return'''
 {{{
 dummy-üñîçøðé.y.!#$%@üñîçøðé.gmail.com
 dummy-email.y.!#$%@gmail.com
 is_email :
 }}}


 Function is_email @ /wp-includes/formatting.php line 2177
 Preg_replace @ line 2211 is not correct.
 {{{
 if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
 }}}

 Function sanitize_email() @ /wp-includes/formatting.php line 2430
 Preg_replace @ line 2460 is not correct.
 {{{
 $local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local
 );
 }}}

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31992#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list