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

WordPress Trac noreply at wordpress.org
Mon Apr 6 16:15:58 UTC 2026


#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:  good-first-bug has-patch has-        |     Focuses:
  screenshots has-unit-tests                     |
-------------------------------------------------+-------------------------

Comment (by ozgursar):

 == Patch Testing Report

 Patch Tested:
 https://core.trac.wordpress.org/attachment/ticket/52976/52976.2.diff

 === Environment
 - WordPress: 7.1-alpha-20260406.185701
 - PHP: 8.3.30
 - Server: PHP.wasm
 - Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
 - Browser: Chrome 146.0.0.0
 - OS: macOS
 - Theme: Twenty Fourteen 4.4
 - MU Plugins: None activated
 - Plugins:
   * Email Logger
   * Test Reports 1.2.1

 === Steps taken
 Install Email Logger plugin from
 https://make.wordpress.org/test/files/2026/02/wp-email-logger.zip

 Method1 - Manually
 1. Change your user's email from admin at localhost.com to
 ADMIN at localhost.com
 2. Observe email notification that contains the email change
 3. Apply patch and repeat the steps 1-2
 4. Observe email notification is not triggered
 5. ✅ Patch is solving the problem

 Method2 - Programmatically
 1. Install any classic theme
 2. Add the following code to your active theme's `functions.php`


 {{{
 $user_id = 1; // ID of the user you are testing
 $user = get_userdata($user_id);
 $original_email = $user->user_email; // e.g., "admin at localhost.com"
 $result = wp_update_user([
     'ID' => $user_id,
     'user_email' => strtoupper($original_email) // "ADMIN at LOCALHOST.COM"
 ]);
 }}}

 3. Visit Users page and observe the user's email
 4. Check email logs and observe the email change notification sent
 5. Apply patch and repeat the steps with a new user
 6. Observe that no notification email sent even though email changes.
 7. ✅ Patch is solving the problem

 In both Method 1 and Method 2, changing the email in any way other than
 capitalization successfully triggers the email change notification.

 === Expected result
 - We expect no notifications to be triggered if only the letter case
 changes.

 === Additional Notes
 - Other locations that use `!==` and `===` for emails comparisons should
 also be checked.

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


More information about the wp-trac mailing list