mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Case insensitivity for is_email_address_unsafe().
props jkudish. fixes #25046. git-svn-id: https://develop.svn.wordpress.org/trunk@25197 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -379,7 +379,10 @@ function is_email_address_unsafe( $user_email ) {
|
||||
$is_email_address_unsafe = false;
|
||||
|
||||
if ( $banned_names && is_array( $banned_names ) ) {
|
||||
list( $email_local_part, $email_domain ) = explode( '@', $user_email );
|
||||
$banned_names = array_map( 'strtolower', $banned_names );
|
||||
$normalized_email = strtolower( $user_email );
|
||||
|
||||
list( $email_local_part, $email_domain ) = explode( '@', $normalized_email );
|
||||
|
||||
foreach ( $banned_names as $banned_domain ) {
|
||||
if ( ! $banned_domain )
|
||||
@@ -391,7 +394,7 @@ function is_email_address_unsafe( $user_email ) {
|
||||
}
|
||||
|
||||
$dotted_domain = ".$banned_domain";
|
||||
if ( $dotted_domain === substr( $user_email, -strlen( $dotted_domain ) ) ) {
|
||||
if ( $dotted_domain === substr( $normalized_email, -strlen( $dotted_domain ) ) ) {
|
||||
$is_email_address_unsafe = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user