Skip to content

Commit 3624bf1

Browse files
committed
Privacy: Set $request->confirm_key earlier so it can be reused in 2 places.
This commit updates the `wp_send_user_request()` function so that the updated confirmation key of the request is available to both the confirmation URL and the subsequent filters (specifically `user_request_action_email_content`). This maintains the existing behavior of generating a new key just-in-time before every user request email is sent. Props birgire, dingo_d, garrett-eclipse, johnjamesjacoby. Fixes #44940. git-svn-id: https://develop.svn.wordpress.org/trunk@61137 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2068d4e commit 3624bf1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/wp-includes/user.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,6 +4844,13 @@ function wp_send_user_request( $request_id ) {
48444844
$switched_locale = switch_to_locale( get_locale() );
48454845
}
48464846

4847+
/*
4848+
* Generate the new user request key first, as it is used by both the $request
4849+
* object and the confirm_url array.
4850+
* See https://core.trac.wordpress.org/ticket/44940
4851+
*/
4852+
$request->confirm_key = wp_generate_user_request_key( $request_id );
4853+
48474854
$email_data = array(
48484855
'request' => $request,
48494856
'email' => $request->email,
@@ -4852,7 +4859,7 @@ function wp_send_user_request( $request_id ) {
48524859
array(
48534860
'action' => 'confirmaction',
48544861
'request_id' => $request_id,
4855-
'confirm_key' => wp_generate_user_request_key( $request_id ),
4862+
'confirm_key' => $request->confirm_key,
48564863
),
48574864
wp_login_url()
48584865
),

0 commit comments

Comments
 (0)