WordPress.org

Make WordPress Core

Ticket #20050: edit_comments.patch

File edit_comments.patch, 1.0 KB (added by nprasath002, 6 years ago)

cap check in edit_comments.php

  • edit-comments.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: C:\xampp\htdocs\wordtrunk\wp-admin
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    88
    99/** WordPress Administration Bootstrap */
    1010require_once('./admin.php');
    11 if ( !current_user_can('edit_posts') )
    12         wp_die(__('Cheatin’ uh?'));
    1311
     12if ( ! $typenow )
     13        wp_die( __( 'Invalid post type' ) );
     14
     15$post_type = $typenow;
     16$post_type_object = get_post_type_object( $post_type );
     17
     18if ( ! $post_type_object )
     19        wp_die( __( 'Invalid post type' ) );
     20
     21if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
     22        wp_die( __( 'Cheatin’ uh?' ) );
     23
    1424$wp_list_table = _get_list_table('WP_Comments_List_Table');
    1525$pagenum = $wp_list_table->get_pagenum();
    1626