Changeset 38787
- Timestamp:
- 10/14/2016 12:04:50 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r38705 r38787 2441 2441 2442 2442 $prefix = $wpdb->get_blog_prefix(); 2443 $regex = implode( '|', wp_roles()->get_names() );2443 $regex = implode( '|', array_keys( wp_roles()->get_names() ) ); 2444 2444 $regex = preg_replace( '/[^a-zA-Z_\|-]/', '', $regex ); 2445 2445 $users = $wpdb->get_col( $wpdb->prepare( " -
trunk/tests/phpunit/tests/user/wpGetUsersWithNoRole.php
r35242 r38787 82 82 } 83 83 84 /** 85 * Role comparison must be done on role name, not role display name. 86 * 87 * @ticket 38234 88 */ 89 public function test_get_users_with_no_role_matches_on_role_name() { 90 // Create a role with a display name which would not match the role name 91 // in a case-insentive SQL query. 92 wp_roles()->add_role( 'somerole', 'Some role display name' ); 93 94 $someuser = self::factory()->user->create( array( 95 'role' => 'somerole', 96 ) ); 97 98 $users = wp_get_users_with_no_role(); 99 100 wp_roles()->remove_role( 'somerole' ); 101 102 $this->assertEmpty( $users ); 103 } 104 84 105 }
Note: See TracChangeset
for help on using the changeset viewer.