From abf27c3b6231b70a1b84910f235d6e9612fd3dc4 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 28 Feb 2019 11:49:51 +0000 Subject: [PATCH] Privacy: Return a more accurate error message when the user cannot perform the requested action. Props mmuhsin, jplojohn, garrett-eclipse, desrosj. Fixes #44833. Built from https://develop.svn.wordpress.org/trunk@44777 git-svn-id: http://core.svn.wordpress.org/trunk@44609 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ajax-actions.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index e125014dd7..4da538bea9 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -4452,7 +4452,7 @@ function wp_ajax_wp_privacy_export_personal_data() { } if ( ! current_user_can( 'export_others_personal_data' ) ) { - wp_send_json_error( __( 'Invalid request.' ) ); + wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) ); } check_ajax_referer( 'wp-privacy-export-personal-data-' . $request_id, 'security' ); @@ -4634,7 +4634,7 @@ function wp_ajax_wp_privacy_erase_personal_data() { // Both capabilities are required to avoid confusion, see `_wp_personal_data_removal_page()`. if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) { - wp_send_json_error( __( 'Invalid request.' ) ); + wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) ); } check_ajax_referer( 'wp-privacy-erase-personal-data-' . $request_id, 'security' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 42bc094b7c..f84889a476 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-44776'; +$wp_version = '5.2-alpha-44777'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.