Make WordPress Core


Ignore:
Timestamp:
04/13/2025 04:46:50 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Check for an empty address first on admin email change notification.

This follows a common best practice of checking for an empty value before doing a specific comparison.

Follow-up to [60122], [60129].

Props dilipbheda, Presskopp.
Fixes #63267.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r60131 r60153  
    81238123    $send = true;
    81248124
    8125     // Don't send the notification to the default 'admin_email' value or an empty value.
    8126     if ( 'you@example.com' === $old_email || empty( $old_email ) ) {
     8125    // Don't send the notification for an empty email address or the default 'admin_email' value.
     8126    if ( empty( $old_email ) || 'you@example.com' === $old_email ) {
    81278127        $send = false;
    81288128    }
Note: See TracChangeset for help on using the changeset viewer.