WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 5 months ago

#22328 new enhancement

Pass reset password URI to retrieve_password_message filter

Reported by: ejdanderson Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Users Keywords: needs-refresh
Focuses: Cc:
PR Number:

Description

The arguments for the <code>retrieve_password_message</code> filter are the message itself and the reset key. However the URI requires the user login as well in order to be valid, thus we cannot regenerate the password reset link without it.

Proposed solution - pass the reset URI instead of just the key.

Attachments (1)

wp-login.2.diff (1.6 KB) - added by ejdanderson 7 years ago.

Download all attachments as: .zip

Change History (7)

#1 follow-up: @SergeyBiryukov
7 years ago

In order to keep backwards compatibility, $reset_url should be added as a new parameter rather than replace an existing one.

#2 in reply to: ↑ 1 ; follow-up: @ejdanderson
7 years ago

  • Summary changed from Unable to regenerate reset password URI from filter argumetns to Unable to regenerate reset password URI from filter arguments

Replying to SergeyBiryukov:

In order to keep backwards compatibility, $reset_url should be added as a new parameter rather than replace an existing one.

I thought about this, and thought - who would be using just the key in their filter? The only reasoning I could come up with is that they're using it in a regex match to extract the URL, but that seemed somewhat unlikely as easier patterns can be derived.

#3 in reply to: ↑ 2 ; follow-up: @SergeyBiryukov
7 years ago

Replying to ejdanderson:

I thought about this, and thought - who would be using just the key in their filter?

It's actually possible to reconstruct the URI using just the key.
See sb_we_lost_password_message() in SB Welcome Email Editor plugin.

#4 in reply to: ↑ 3 @ejdanderson
7 years ago

Replying to SergeyBiryukov:

It's actually possible to reconstruct the URI using just the key.
See sb_we_lost_password_message() in SB Welcome Email Editor plugin.

This makes sense. I've updated the patch to reflect this and just pass the $reset_url as another parameter.

#5 @SergeyBiryukov
7 years ago

  • Summary changed from Unable to regenerate reset password URI from filter arguments to Pass reset password URI to retrieve_password_message filter
  • Type changed from defect (bug) to enhancement

#6 @chriscct7
4 years ago

  • Keywords needs-refresh added; has-patch removed
Note: See TracTickets for help on using tickets.