Make WordPress Core

Ticket #42985: 42985.2.diff

File 42985.2.diff, 992 bytes (added by audrasjb, 6 years ago)

Re-add wp-login errors

  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index eb8f0a1..3414da0 100644
    a b function wp_signon( $credentials = array(), $secure_cookie = '' ) { 
    9595        $user = wp_authenticate( $credentials['user_login'], $credentials['user_password'] );
    9696
    9797        if ( is_wp_error( $user ) ) {
    98                 if ( $user->get_error_codes() == array( 'empty_username', 'empty_password' ) ) {
    99                         $user = new WP_Error( '', '' );
    100                 }
    101 
    10298                return $user;
    10399        }
    104100
  • src/wp-login.php

    diff --git a/src/wp-login.php b/src/wp-login.php
    index 72fcae2..7b1c9e2 100644
    a b switch ( $action ) { 
    10061006                if ( ! empty( $_GET['loggedout'] ) || $reauth ) {
    10071007                        $errors = new WP_Error();
    10081008                }
     1009               
     1010                if ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) {
     1011                        $errors = new WP_Error( '', '' );
     1012                }
    10091013
    10101014                if ( $interim_login ) {
    10111015                        if ( ! $errors->has_errors() ) {