Make WordPress Core

Changeset 44777


Ignore:
Timestamp:
02/28/2019 11:48:46 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Privacy: Return a more accurate error message when the user cannot perform the requested action.

Props mmuhsin, jplojohn, garrett-eclipse, desrosj.
Fixes #44833.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r44537 r44777  
    44534453
    44544454    if ( ! current_user_can( 'export_others_personal_data' ) ) {
    4455         wp_send_json_error( __( 'Invalid request.' ) );
     4455        wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );
    44564456    }
    44574457
     
    46354635    // Both capabilities are required to avoid confusion, see `_wp_personal_data_removal_page()`.
    46364636    if ( ! current_user_can( 'erase_others_personal_data' ) || ! current_user_can( 'delete_users' ) ) {
    4637         wp_send_json_error( __( 'Invalid request.' ) );
     4637        wp_send_json_error( __( 'Sorry, you are not allowed to perform this action.' ) );
    46384638    }
    46394639
Note: See TracChangeset for help on using the changeset viewer.