WordPress.org

Make WordPress Core

Ticket #21982: check_wp_authenticate_cookie.patch

File check_wp_authenticate_cookie.patch, 596 bytes (added by fitorec, 6 years ago)
  • wp-includes/user.php

     
    117117 * Authenticate the user using the WordPress auth cookie.
    118118 */
    119119function wp_authenticate_cookie($user, $username, $password) {
    120         if ( is_a($user, 'WP_User') ) { return $user; }
    121 
    122         if ( empty($username) && empty($password) ) {
     120        if ( !is_a($user, 'WP_User') && empty($username) && empty($password) ) {
    123121                $user_id = wp_validate_auth_cookie();
    124122                if ( $user_id )
    125123                        return new WP_User($user_id);