From dec7dd74eafa57183262ba01265a52f96b65ae8d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 14 Oct 2016 12:05:30 +0000 Subject: [PATCH] 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 Built from https://develop.svn.wordpress.org/trunk@38787 git-svn-id: http://core.svn.wordpress.org/trunk@38730 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index a83e57e099..22c2c1ea1d 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2440,7 +2440,7 @@ function wp_get_users_with_no_role() { } $prefix = $wpdb->get_blog_prefix(); - $regex = implode( '|', wp_roles()->get_names() ); + $regex = implode( '|', array_keys( wp_roles()->get_names() ) ); $regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex ); $users = $wpdb->get_col( $wpdb->prepare( " SELECT user_id diff --git a/wp-includes/version.php b/wp-includes/version.php index 8b2b051cf6..07f755c745 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38786'; +$wp_version = '4.7-alpha-38787'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.