Make WordPress Core

Changeset 19056


Ignore:
Timestamp:
10/24/2011 09:31:30 PM (13 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r19028 r19056  
    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'], '@') ) {
    175         $user_data = get_user_by('email', trim($_POST['user_login']));
    176         if ( empty($user_data) )
     173    } else if ( strpos( $_POST['user_login'], '@' ) ) {
     174        $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
     175        if ( empty( $user_data ) )
    177176            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
    178177    } else {
Note: See TracChangeset for help on using the changeset viewer.