Ticket #38432: 38432.2.patch
File 38432.2.patch, 1.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/user.php
1803 1803 $user->set_role( $userdata['role'] ); 1804 1804 } elseif ( ! $update ) { 1805 1805 $user->set_role( get_option( 'default_role' ) ); 1806 } elseif( ( isset( $_GET['action'] ) ) && ( $_GET['action'] == "register" ) ) { 1807 $user->set_role( '' ); 1806 1808 } 1807 1809 wp_cache_delete( $user_id, 'users' ); 1808 1810 wp_cache_delete( $user_login, 'userlogins' ); -
src/wp-login.php
653 653 654 654 if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) { 655 655 list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 ); 656 $user = check_password_reset_key( $rp_key, $rp_login ); 656 $user = check_password_reset_key( $rp_key, $rp_login ); 657 // Get user form using WP_User query with user ID argument. 658 $update_user = new WP_User( $user->ID ); 659 // Update default role for register user from admin side. 660 $update_user->set_role( get_option( 'default_role' ) ); 657 661 if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) { 658 662 $user = false; 659 663 }