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
This commit is contained in:
Jeremy Felt 2018-03-20 19:07:31 +00:00
parent d0e1b54105
commit b05cb5e5ed
2 changed files with 4 additions and 3 deletions

View File

@ -497,8 +497,9 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
$limited_email_domains = get_site_option( 'limited_email_domains' ); $limited_email_domains = get_site_option( 'limited_email_domains' );
if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {
$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); $limited_email_domains = array_map( 'strtolower', $limited_email_domains );
if ( ! in_array( $emaildomain, $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!' ) ); $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) );
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @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. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.