Privacy: When clicking a confirmation link for a privacy request, return 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.
Built from https://develop.svn.wordpress.org/branches/4.9@43624


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-09-03 21:47:25 +00:00
parent 7296f063d7
commit c04ce8198b
2 changed files with 2 additions and 2 deletions

View File

@ -3449,7 +3449,7 @@ function wp_validate_user_request_key( $request_id, $key ) {
} }
if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) { 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 ) ) { if ( empty( $key ) ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9.9-alpha-43622'; $wp_version = '4.9.9-alpha-43624';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.