[wp-trac] [WordPress Trac] #52976: user emails comparison should be case insensitive

WordPress Trac noreply at wordpress.org
Tue Apr 6 03:58:38 UTC 2021


#52976: user emails comparison should be case insensitive
----------------------------------------+------------------------------
 Reporter:  asaifm                      |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Users                       |     Version:  4.3
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => needs-patch good-first-bug


Comment:

 Just noting the locations I could find that use `!=` for email
 comparisons:

 {{{
 wp-includes/user.php:           if ( $user_email !==
 $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) {
 wp-includes/user.php:   if ( isset( $userdata['user_email'] ) &&
 $user['user_email'] !== $userdata['user_email'] ) {

 wp-admin/user-edit.php:         if ( $new_email && $new_email['newemail']
 != $current_user->user_email && $profileuser->ID == $current_user->ID ) :

 wp-admin/index.php:     $hide = ( 0 === $option || ( 2 === $option &&
 wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) );

 wp-admin/includes/class-wp-screen.php:                          if ( 2 ===
 $welcome_checked && wp_get_current_user()->user_email !== get_option(
 'admin_email' ) ) {

 wp-admin/options-general.php:if ( $new_admin_email && get_option(
 'admin_email' ) !== $new_admin_email ) :

 }}}

 And for completeness, those which use strcasecmp():
 {{{
 wp-includes/capabilities.php:   if ( $user && 0 !== strcasecmp(
 $user->user_email, get_site_option( 'admin_email' ) ) ) {
 wp-includes/pluggable.php:                      if ( 0 !== strcasecmp(
 $user->user_email, get_option( 'admin_email' ) ) ) {
 wp-includes/pluggable.php:              if ( 0 !== strcasecmp(
 $user->user_email, get_option( 'admin_email' ) ) ) {
 wp-includes/user.php:   if ( ( ! $update || ( ! empty( $old_user_data ) &&
 0 !== strcasecmp( $user_email, $old_user_data->user_email ) ) )
 wp-admin/user-edit.php:                 <?php if ( 0 !== strcasecmp(
 $profileuser->user_email, get_site_option( 'admin_email' ) ) || !
 is_super_admin( $profileuser->ID ) ) : ?>
 }}}

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


More information about the wp-trac mailing list