WordPress.org

Make WordPress Core

Ticket #42985: 42985.diff

File 42985.diff, 1.0 KB (added by birgire, 2 years ago)
  • src/wp-includes/user.php

    diff --git src/wp-includes/user.php src/wp-includes/user.php
    index 9a685b9..b57848f 100644
    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 src/wp-login.php src/wp-login.php
    index 6415b15..6f7ed5c 100644
    switch ( $action ) { 
    972972                        $errors = new WP_Error();
    973973                }
    974974
     975                if ( empty( $_POST ) && $errors->get_error_codes() === array( 'empty_username', 'empty_password' ) ) {
     976                        $errors = new WP_Error( '', '' );
     977                }
     978
    975979                if ( $interim_login ) {
    976980                        if ( ! $errors->get_error_code() ) {
    977981                                $errors->add( 'expired', __( 'Your session has expired. Please log in to continue where you left off.' ), 'message' );