Make WordPress Core

Ticket #18755: 18755.patch

File 18755.patch, 737 bytes (added by ampt, 13 years ago)
  • wp-login.php

     
    168168
    169169        $errors = new WP_Error();
    170170
    171         if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
     171        if ( empty( $_POST['user_login'] ) ) {
    172172                $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
    173 
    174         if ( strpos($_POST['user_login'], '@') ) {
     173        }
     174        else if ( strpos($_POST['user_login'], '@') ) {
    175175                $user_data = get_user_by('email', trim($_POST['user_login']));
    176176                if ( empty($user_data) )
    177177                        $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));