Avoid warning when user_login not in POST. Props ampt. fixes #18755

git-svn-id: http://svn.automattic.com/wordpress/trunk@19056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-10-24 21:31:30 +00:00
parent d7e24531ef
commit b75f3e8f07
1 changed files with 4 additions and 5 deletions

View File

@ -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']);