Make WordPress Core

Ticket #31787: 31787.patch

File 31787.patch, 1.9 KB (added by mrtortai, 10 years ago)

Patch 31787.patch

  • src/wp-login.php

     
    278278                $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
    279279        } elseif ( strpos( $_POST['user_login'], '@' ) ) {
    280280                $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
    281                 if ( empty( $user_data ) )
    282                         $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
    283281        } else {
    284282                $login = trim($_POST['user_login']);
    285283                $user_data = get_user_by('login', $login);
     
    295293        if ( $errors->get_error_code() )
    296294                return $errors;
    297295
    298         if ( !$user_data ) {
    299                 $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
    300                 return $errors;
    301         }
    302 
    303296        // Redefining user_login ensures we return the right case in the email.
     297    if ( $user_data ) {
    304298        $user_login = $user_data->user_login;
    305299        $user_email = $user_data->user_email;
     300    } else {
     301        return;
     302    }
    306303
    307304        /**
    308305         * Fires before a new password is retrieved.
     
    861858                elseif  ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
    862859                        $errors->add('registerdisabled', __('User registration is currently not allowed.'));
    863860                elseif  ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
    864                         $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
     861            $errors->add('confirm', __('If this username or email address is correct, you will receive an email confirmation link shortly.'), 'message');
    865862                elseif  ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
    866863                        $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
    867864                elseif  ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )