Make WordPress Core

Ticket #14949: 14949.2.diff

File 14949.2.diff, 637 bytes (added by lukecavanagh, 8 years ago)

Patch refresh

  • src/wp-login.php

     
    788788
    789789        $user = wp_signon( array(), $secure_cookie );
    790790
     791        $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
     792
     793        if ( is_wp_error( $user ) && is_user_logged_in() ) {
     794                        $user = wp_get_current_user();
     795        }
     796
    791797        if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
    792798                if ( headers_sent() ) {
    793799                        /* translators: 1: Browser cookie documentation URL, 2: Support forums URL */