Make WordPress Core

Ticket #33672: 33672.diff

File 33672.diff, 1.2 KB (added by kraftbj, 9 years ago)

original props ericlewis. modified from original

  • src/wp-admin/media-upload.php

     
    1515/** Load WordPress Administration Bootstrap */
    1616require_once( dirname( __FILE__ ) . '/admin.php' );
    1717
    18 if (!current_user_can('upload_files'))
    19         wp_die(__('You do not have permission to upload files.'));
     18if ( ! current_user_can( 'upload_files' ) ) {
     19        wp_die( __( 'You do not have permission to upload files.' ), 403 );
     20}
    2021
    2122wp_enqueue_script('plupload-handlers');
    2223wp_enqueue_script('image-edit');
     
    3233
    3334// Require an ID for the edit screen.
    3435if ( isset($action) && $action == 'edit' && !$ID ) {
    35         wp_die( __( 'Cheatin’ uh?' ), 403 );
     36        wp_die(
     37                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     38                '<p>' . __( 'This is not a valid item.' ) . '</p>',
     39                403 );
    3640}
    3741
    3842if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
    39         wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     43        wp_die(
     44                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     45                '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>',
     46                403 );
    4047}
    4148
    4249// Upload type: image, video, file, ..?