mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Avoid warning when user_login not in POST. Props ampt. fixes #18755
git-svn-id: https://develop.svn.wordpress.org/trunk@19056 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e253f44dad
commit
a8973fb429
@ -168,12 +168,11 @@ function retrieve_password() {
|
||||
|
||||
$errors = new WP_Error();
|
||||
|
||||
if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
|
||||
if ( empty( $_POST['user_login'] ) ) {
|
||||
$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
|
||||
|
||||
if ( strpos($_POST['user_login'], '@') ) {
|
||||
$user_data = get_user_by('email', trim($_POST['user_login']));
|
||||
if ( empty($user_data) )
|
||||
} else if ( strpos( $_POST['user_login'], '@' ) ) {
|
||||
$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
|
||||
if ( empty( $user_data ) )
|
||||
$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
|
||||
} else {
|
||||
$login = trim($_POST['user_login']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user