WordPress.org

Make WordPress Core

Ticket #14949: no-false-logout-message.14949.diff

File no-false-logout-message.14949.diff, 524 bytes (added by filosofo, 4 years ago)
  • wp-login.php

     
    534534        $user = wp_signon('', $secure_cookie); 
    535535 
    536536        $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user); 
     537         
     538        if ( is_wp_error( $user ) && is_user_logged_in() ) { 
     539                $user = wp_get_current_user(); 
     540        } 
    537541 
    538542        if ( !is_wp_error($user) && !$reauth ) { 
    539543                if ( $interim_login ) {