From ff0b621719ae92422ef1c92b1adb9fadb3a99383 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 13 Oct 2015 01:32:25 +0000 Subject: [PATCH] Don't match partial roles in `WP_User_Query`. Because 'role=ocean90' shouldn't match 'role=bocean901'. Props bocean901, ocean90. Fixes #22212. Built from https://develop.svn.wordpress.org/trunk@35101 git-svn-id: http://core.svn.wordpress.org/trunk@35066 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-user-query.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-user-query.php b/wp-includes/class-wp-user-query.php index 55b284b1b8..8a6a3cf8a4 100644 --- a/wp-includes/class-wp-user-query.php +++ b/wp-includes/class-wp-user-query.php @@ -304,7 +304,7 @@ class WP_User_Query { foreach ( $roles as $role ) { $roles_clauses[] = array( 'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', - 'value' => $role, + 'value' => '"' . $role . '"', 'compare' => 'LIKE', ); } @@ -317,7 +317,7 @@ class WP_User_Query { foreach ( $role__in as $role ) { $role__in_clauses[] = array( 'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', - 'value' => $role, + 'value' => '"' . $role . '"', 'compare' => 'LIKE', ); } @@ -330,7 +330,7 @@ class WP_User_Query { foreach ( $role__not_in as $role ) { $role__not_in_clauses[] = array( 'key' => $wpdb->get_blog_prefix( $blog_id ) . 'capabilities', - 'value' => $role, + 'value' => '"' . $role . '"', 'compare' => 'NOT LIKE', ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1035f23057..4150128ba9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35100'; +$wp_version = '4.4-alpha-35101'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.