Ticket #38432: 38432.patch
File 38432.patch, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/user.php
1748 1748 $user->set_role( $userdata['role'] ); 1749 1749 } elseif ( ! $update ) { 1750 1750 $user->set_role(get_option('default_role')); 1751 } elseif( ( isset( $_GET['action'] ) ) && ( $_GET['action'] == "register" ) ) { 1752 $user->set_role(''); 1751 1753 } 1752 1754 wp_cache_delete( $user_id, 'users' ); 1753 1755 wp_cache_delete( $user_login, 'userlogins' ); -
src/wp-login.php
636 636 if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) { 637 637 list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 ); 638 638 $user = check_password_reset_key( $rp_key, $rp_login ); 639 $update_user = new WP_User( $user->ID ); 640 $update_user->set_role( 'subscriber' ); 639 641 if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) { 640 642 $user = false; 641 643 } … … 642 644 } else { 643 645 $user = false; 644 646 } 645 646 647 if ( ! $user || is_wp_error( $user ) ) { 647 648 setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true ); 648 649 if ( $user && $user->get_error_code() === 'expired_key' )