diff --git src/wp-includes/user.php b/user.php
index 566702f..4a530b1 100755
old
|
new
|
function register_new_user( $user_login, $user_email ) { |
2439 | 2439 | } |
2440 | 2440 | |
2441 | 2441 | /** |
| 2442 | * Additional checks for cross-referenced email and username among existing accounts. |
| 2443 | * Prevent using existing email address as username and vice versa. |
| 2444 | * Do not allow an existing email address to be used as a username of the new account. |
| 2445 | * Do not allow an existing username to be used as the email address of the new account. |
| 2446 | */ |
| 2447 | |
| 2448 | // Check if username is being used as the email address of another account. |
| 2449 | if ( email_exists( $sanitized_user_login ) ) { |
| 2450 | $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This username is invalid because it is already the email address of another account.' ) ); |
| 2451 | } |
| 2452 | |
| 2453 | // Check if email address is being used as the username of another account. |
| 2454 | if ( '' !== $user_email && username_exists( $user_email ) ) { |
| 2455 | $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This email address cannot be used because it is already the username of another account.' ) ); |
| 2456 | } |
| 2457 | |
| 2458 | /** |
2442 | 2459 | * Fires when submitting registration form data, before the user is created. |
2443 | 2460 | * |
2444 | 2461 | * @since 2.1.0 |