WordPress.org

Make WordPress Core

Changeset 24719


Ignore:
Timestamp:
07/17/13 04:46:09 (9 months ago)
Author:
nacin
Message:

Avoid a sanitize_key() call on ID, as this causes it to be lowercased. wp_dropdown_users() requires user_login as a fallback; specify it for get_users(). see #21767.

File:
1 edited

Legend:

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

    r24714 r24719  
    393393 
    394394            $this->query_fields = array(); 
    395             foreach ( $qv['fields'] as $field ) 
    396                 $this->query_fields[] = $wpdb->users . '.' . sanitize_key( $field ); 
     395            foreach ( $qv['fields'] as $field ) { 
     396                $field = 'ID' === $field ? 'ID' : sanitize_key( $field ); 
     397                $this->query_fields[] = "$wpdb->users.$field"; 
     398            } 
    397399            $this->query_fields = implode( ',', $this->query_fields ); 
    398400        } elseif ( 'all' == $qv['fields'] ) { 
     
    10301032 
    10311033    $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) ); 
    1032     $query_args['fields'] = array( 'ID', $show ); 
     1034    $query_args['fields'] = array( 'ID', 'user_login', $show ); 
    10331035    $users = get_users( $query_args ); 
    10341036 
Note: See TracChangeset for help on using the changeset viewer.