Skip to content
Permalink
Browse files

Privacy: When clicking a confirmation link for a privacy request, ret…

…urn a `WP_Error` object if the link has expired.

Returning a string caused a success message to be displayed instead of the correct error message.

Props desrosj.
Merges [43623] to the 4.9 branch.
Fixes #44685.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43624 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Sep 3, 2018
1 parent 1b18dc5 commit aadaa64d03cdd73376850f2bd361d759d4dd6228
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/wp-includes/user.php
@@ -3449,7 +3449,7 @@ function wp_validate_user_request_key( $request_id, $key ) {
}
if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) {
return __( 'This link has expired.' );
return new WP_Error( 'expired_link', __( 'This link has expired.' ) );
}
if ( empty( $key ) ) {

0 comments on commit aadaa64

Please sign in to comment.
You can’t perform that action at this time.