[wp-trac] [WordPress Trac] #44940: Empty confirm_key property in WP_User_Request when hooking in the user_request_action_email_content

WordPress Trac noreply at wordpress.org
Thu Sep 13 17:34:19 UTC 2018


#44940: Empty confirm_key property in WP_User_Request when hooking in the
user_request_action_email_content
--------------------------------------+------------------------------
 Reporter:  dingo_bastard             |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Privacy                   |     Version:  4.9.6
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback 2nd-opinion  |     Focuses:  privacy
--------------------------------------+------------------------------
Changes (by birgire):

 * version:  4.9.8 => 4.9.6
 * severity:  major => normal


Comment:

 Thanks for the ticket @dingo_bastard

 Having the confirm key available within these filters seems useful.

 Within {{{wp_send_user_request( $request_id )}}} the request is fetched by
 request ID with {{{wp_get_user_request_data( $request_id )}}}.

 At that moment the confirm key has not been generated for the request.

 Then the confirm key is generated by calling
 {{{wp_generate_user_request_key( $request_id )}}}.

 That means the request is updated and stores the confirm key in the
 {{{post_password}}} field.

 But then the request object, in the {{{$email_data}}}, becomes "dirty"
 (not refreshed) so it's still with an empty confirm key.

 At first glance it seems that possible fixes could be to:

 - Re-fetch the request object into the {{{$email_data}}}.
 - Only update the {{{confirm_key}}} attribute, of the request object into
 the {{{$email_data}}}. But there's currently no {{{set}}} method in
 {{{WP_User_Request}}}.
 - Set the confirm key explicitly into {{{$email_data['confirm_key']}}}.
 - ...

 after the confirm key is generated.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44940#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list