From 811eef33a31aab13d38a13522d4a58419566225b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 3 Sep 2018 21:43:13 +0000 Subject: [PATCH] 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. Fixes #44685. git-svn-id: https://develop.svn.wordpress.org/trunk@43623 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 40f227c5d6..09be161e15 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -3545,7 +3545,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 ) ) {