diff --git a/wp-includes/user.php b/wp-includes/user.php index eb8f0a13aa..3414da0fbc 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -95,10 +95,6 @@ function wp_signon( $credentials = array(), $secure_cookie = '' ) { $user = wp_authenticate( $credentials['user_login'], $credentials['user_password'] ); if ( is_wp_error( $user ) ) { - if ( $user->get_error_codes() == array( 'empty_username', 'empty_password' ) ) { - $user = new WP_Error( '', '' ); - } - return $user; } diff --git a/wp-includes/version.php b/wp-includes/version.php index f8bc63a916..fec603fdb2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44917'; +$wp_version = '5.2-alpha-44918'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 72fcae266d..b02a2b9e70 100644 --- a/wp-login.php +++ b/wp-login.php @@ -1007,6 +1007,10 @@ switch ( $action ) { $errors = new WP_Error(); } + if ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) { + $errors = new WP_Error( '', '' ); + } + if ( $interim_login ) { if ( ! $errors->has_errors() ) { $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );