Make WordPress Core

Changeset 60122


Ignore:
Timestamp:
04/02/2025 10:23:08 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Check for an empty mail server URL first in wp-mail.php.

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

Follow-up to [39772].

Props dilipbheda, mukesh27.
Fixes #63219.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-mail.php

    r59790 r60122  
    1818$mailserver_url = get_option( 'mailserver_url' );
    1919
    20 if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) {
     20if ( empty( $mailserver_url ) || 'mail.example.com' === $mailserver_url ) {
    2121    wp_die( __( 'This action has been disabled by the administrator.' ), 403 );
    2222}
Note: See TracChangeset for help on using the changeset viewer.