Ticket #44940: 44940-breaking.diff
| File 44940-breaking.diff, 2.2 KB (added by , 12 months ago) |
|---|
-
src/wp-includes/class-wp-user-request.php
116 116 $this->confirmed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_confirmed_timestamp', true ); 117 117 $this->completed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_completed_timestamp', true ); 118 118 $this->request_data = json_decode( $post->post_content, true ); 119 $this->confirm_key = $post->post_password; 119 120 // See: https://core.trac.wordpress.org/ticket/44940 121 if ( ! empty( $post->post_password ) ) { 122 $this->confirm_key = $post->post_password; 123 } else { 124 // Backwards compatibility for requests lacking a confirm key. 125 $this->confirm_key = wp_generate_user_request_key( $post->ID ); 126 } 120 127 } 121 128 } -
src/wp-includes/user.php
4845 4845 array( 4846 4846 'action' => 'confirmaction', 4847 4847 'request_id' => $request_id, 4848 'confirm_key' => wp_generate_user_request_key( $request_id ),4848 'confirm_key' => $request->confirm_key, 4849 4849 ), 4850 4850 wp_login_url() 4851 4851 ), … … 4968 4968 * Returns a confirmation key for a user action and stores the hashed version for future comparison. 4969 4969 * 4970 4970 * @since 4.9.6 4971 * @since 6.9.0 Request ID optional. See: https://core.trac.wordpress.org/ticket/44940 4971 4972 * 4972 * @param int $request_id Request ID.4973 * @param int $request_id Optional. Request ID. Default 0. 4973 4974 * @return string Confirmation key. 4974 4975 */ 4975 function wp_generate_user_request_key( $request_id ) {4976 function wp_generate_user_request_key( $request_id = 0 ) { 4976 4977 // Generate something random for a confirmation key. 4977 4978 $key = wp_generate_password( 20, false ); 4978 4979 4979 // Save the key, hashed. 4980 wp_update_post( 4981 array( 4982 'ID' => $request_id, 4983 'post_status' => 'request-pending', 4984 'post_password' => wp_fast_hash( $key ), 4985 ) 4986 ); 4980 // Maybe save the hashed key to the request, if ID passed. 4981 if ( $request_id ) { 4982 wp_update_post( 4983 array( 4984 'ID' => $request_id, 4985 'post_status' => 'request-pending', 4986 'post_password' => wp_fast_hash( $key ), 4987 ) 4988 ); 4989 } 4987 4990 4988 4991 return $key; 4989 4992 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)