summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-04-13 16:46:50 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2025-04-13 16:46:50 +0000
commit6507226317acc6d748239e362f6bd683b235ce1f (patch)
tree5d034c617047c658a6c84a96bbd24415d187a15d
parentd664c3c8f48ed379f8a9720a7d74d518fe3f8100 (diff)
downloadwordpress-6507226317acc6d748239e362f6bd683b235ce1f.tar.gz
wordpress-6507226317acc6d748239e362f6bd683b235ce1f.zip
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
-rw-r--r--src/wp-includes/functions.php4
-rw-r--r--src/wp-includes/ms-functions.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index 32e530a4d2..08f19287af 100644
--- a/src/wp-includes/functions.php
+++ b/src/wp-includes/functions.php
@@ -8122,8 +8122,8 @@ function wp_cache_set_last_changed( $group ) {
function wp_site_admin_email_change_notification( $old_email, $new_email, $option_name ) {
$send = true;
- // Don't send the notification to the default 'admin_email' value or an empty value.
- if ( 'you@example.com' === $old_email || empty( $old_email ) ) {
+ // Don't send the notification for an empty email address or the default 'admin_email' value.
+ if ( empty( $old_email ) || 'you@example.com' === $old_email ) {
$send = false;
}
diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
index 7b87c1fb7c..cbec24ab5e 100644
--- a/src/wp-includes/ms-functions.php
+++ b/src/wp-includes/ms-functions.php
@@ -2869,8 +2869,8 @@ All at ###SITENAME###
function wp_network_admin_email_change_notification( $option_name, $new_email, $old_email, $network_id ) {
$send = true;
- // Don't send the notification to the default 'admin_email' value or an empty value.
- if ( 'you@example.com' === $old_email || empty( $old_email ) ) {
+ // Don't send the notification for an empty email address or the default 'admin_email' value.
+ if ( empty( $old_email ) || 'you@example.com' === $old_email ) {
$send = false;
}