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

WordPress Trac noreply at wordpress.org
Wed Apr 15 12:43:01 UTC 2026


#31992: Unicode Email Addresses
-------------------------------------------------+-------------------------
 Reporter:  ysalame                              |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  7.1
Component:  Formatting                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-test-info has-patch has-         |     Focuses:
  screenshots has-unit-tests dev-feedback early  |
-------------------------------------------------+-------------------------
Description changed by dmsnell:

Old 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 );
> }}}
>
> == Related
>
>  - #24487 `is_email()` doesn’t recognize IDN domains.

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
 );
 }}}

 == Related

  - #4616 Previous validation expansions.
  - #9316 Introduces complex email validation with messages for rejected
 inputs.
  - #24487 `is_email()` doesn’t recognize IDN domains.

--

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


More information about the wp-trac mailing list