Skip to content

Commit 6507226

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@60153 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d664c3c commit 6507226

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/wp-includes/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8122,8 +8122,8 @@ function wp_cache_set_last_changed( $group ) {
81228122
function wp_site_admin_email_change_notification( $old_email, $new_email, $option_name ) {
81238123
$send = true;
81248124

8125-
// Don't send the notification to the default 'admin_email' value or an empty value.
8126-
if ( '[email protected]' === $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 ) || '[email protected]' === $old_email ) {
81278127
$send = false;
81288128
}
81298129

src/wp-includes/ms-functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,8 +2869,8 @@ function update_network_option_new_admin_email( $old_value, $value ) {
28692869
function wp_network_admin_email_change_notification( $option_name, $new_email, $old_email, $network_id ) {
28702870
$send = true;
28712871

2872-
// Don't send the notification to the default 'admin_email' value or an empty value.
2873-
if ( '[email protected]' === $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 ) || '[email protected]' === $old_email ) {
28742874
$send = false;
28752875
}
28762876

0 commit comments

Comments
 (0)