From 7ee752e40cf47feb2591711efb8074217b6961f2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 3 Sep 2018 21:44:24 +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. Built from https://develop.svn.wordpress.org/trunk@43623 git-svn-id: http://core.svn.wordpress.org/trunk@43452 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 40f227c5d6..09be161e15 100644 --- a/wp-includes/user.php +++ b/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 ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 959ee4ca47..ed129c1231 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43616'; +$wp_version = '5.0-alpha-43623'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.