WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/30/2012 09:04:48 PM (9 years ago)
Author:
nacin
Message:

Clean up cap checks for autocompletes for sites and users in a network. see #19810.

File:
1 edited

Legend:

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

    r20319 r20332  
    151151
    152152function wp_ajax_autocomplete_user() {
    153     if ( ! is_multisite()
    154         || ! current_user_can( 'promote_users' )
    155         || wp_is_large_network( 'users' )
    156         || ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
    157     ) {
    158         wp_die( -1 );
    159     }
     153    if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
     154        wp_die( -1 );
     155
     156    if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
     157        wp_die( -1 );
    160158
    161159    $return = array();
     
    216214
    217215function wp_ajax_autocomplete_site() {
    218     if ( ! is_multisite()
    219         || ! current_user_can( 'manage_sites' )
    220         || wp_is_large_network( 'sites' )
    221         || ! is_super_admin()
    222     ) {
    223         wp_die( -1 );
    224     }
     216    if ( ! is_multisite() || ! current_user_can( 'manage_sites' ) || wp_is_large_network( 'sites' ) )
     217        wp_die( -1 );
    225218
    226219    $return = array();
Note: See TracChangeset for help on using the changeset viewer.