From b05cb5e5ed6b537dfacbd59a1cb860ebd75e1ae6 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 20 Mar 2018 19:07:31 +0000 Subject: [PATCH] Multisite: Use case-insensitive check on email domain whitelist. Props greatislander. Fixes #43148. Built from https://develop.svn.wordpress.org/trunk@42858 git-svn-id: http://core.svn.wordpress.org/trunk@42688 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 93662fa923..cc797a7bd0 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -497,8 +497,9 @@ function wpmu_validate_user_signup( $user_name, $user_email ) { $limited_email_domains = get_site_option( 'limited_email_domains' ); if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { - $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); - if ( ! in_array( $emaildomain, $limited_email_domains ) ) { + $limited_email_domains = array_map( 'strtolower', $limited_email_domains ); + $emaildomain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) ); + if ( ! in_array( $emaildomain, $limited_email_domains, true ) ) { $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 68e3dad7eb..2a7ce8cdbe 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42857'; +$wp_version = '5.0-alpha-42858'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.