Make WordPress Core


Ignore:
Timestamp:
12/16/2010 09:18:28 AM (14 years ago)
Author:
nacin
Message:

Replace check_permissions() with ajax_user_can(). New method returns true/false to current_user_can(), which we then handle in admin ajax. see #15326.

File:
1 edited

Legend:

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

    r16991 r16992  
    6262        die( '0' );
    6363
    64     $wp_list_table->check_permissions();
     64    if ( ! $wp_list_table->ajax_user_can() )
     65        die( '-1' );
     66
    6567    $wp_list_table->ajax_response();
    6668
     
    12011203    check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
    12021204
    1203     set_current_screen( 'edit-' . $_POST['taxonomy'] );
     1205    $taxonomy = sanitize_key( $_POST['taxonomy'] );
     1206    $tax = get_taxonomy( $taxonomy );
     1207    if ( ! $tax )
     1208        die( '0' );
     1209
     1210    if ( ! current_user_can( $tax->cap->edit_terms ) )
     1211        die( '-1' );
     1212
     1213    set_current_screen( 'edit-' . $taxonomy );
    12041214
    12051215    $wp_list_table = get_list_table('WP_Terms_List_Table');
    1206 
    1207     $wp_list_table->check_permissions('edit');
    12081216
    12091217    if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
Note: See TracChangeset for help on using the changeset viewer.