Make WordPress Core

Changeset 60153


Ignore:
Timestamp:
04/13/2025 04:46:50 PM (2 weeks 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.

Location:
trunk/src/wp-includes
Files:
2 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    }
  • trunk/src/wp-includes/ms-functions.php

    r60147 r60153  
    28702870    $send = true;
    28712871
    2872     // Don't send the notification to the default 'admin_email' value or an empty value.
    2873     if ( 'you@example.com' === $old_email || empty( $old_email ) ) {
     2872    // Don't send the notification for an empty email address or the default 'admin_email' value.
     2873    if ( empty( $old_email ) || 'you@example.com' === $old_email ) {
    28742874        $send = false;
    28752875    }
Note: See TracChangeset for help on using the changeset viewer.