Make WordPress Core


Ignore:
Timestamp:
08/19/2017 01:29:03 PM (7 years ago)
Author:
johnbillion
Message:

Media: bring the capability check in wp_ajax_crop_image() inline with those in wp_ajax_imgedit_preview() and wp_ajax_image_editor().

This change means that a user can crop an image if they have the ability to edit its attachment post, without requiring the ability to access the Customizer.

Fixes #40193

File:
1 edited

Legend:

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

    r41198 r41270  
    32203220
    32213221    check_ajax_referer( 'image_editor-' . $attachment_id, 'nonce' );
    3222     if ( ! current_user_can( 'customize' ) ) {
     3222    if ( empty( $attachment_id ) || ! current_user_can( 'edit_post', $attachment_id ) ) {
    32233223        wp_send_json_error();
    32243224    }
Note: See TracChangeset for help on using the changeset viewer.