Make WordPress Core

Changeset 61137


Ignore:
Timestamp:
11/04/2025 06:58:49 PM (5 days ago)
Author:
johnjamesjacoby
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r61038 r61137  
    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,
     
    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()
Note: See TracChangeset for help on using the changeset viewer.