Make WordPress Core


Ignore:
Timestamp:
10/14/2016 12:04:50 PM (9 years ago)
Author:
johnbillion
Message:

Users: Use the role name instead of the role display name when fetching the list of users with no role. This avoids false positives when dealing with user roles that, for example, contain spaces in the display name.

Props procodewp, choongsavvii
Fixes #38234

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r38705 r38787  
    24412441
    24422442    $prefix = $wpdb->get_blog_prefix();
    2443     $regex  = implode( '|', wp_roles()->get_names() );
     2443    $regex  = implode( '|', array_keys( wp_roles()->get_names() ) );
    24442444    $regex  = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex );
    24452445    $users  = $wpdb->get_col( $wpdb->prepare( "
Note: See TracChangeset for help on using the changeset viewer.