[wp-trac] [WordPress Trac] #9253: _fill_user does not handle multi-value usermeta keys properly

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 28 22:48:57 GMT 2009


#9253: _fill_user does not handle multi-value usermeta keys properly
--------------------------+-------------------------------------------------
 Reporter:  bkrausz       |       Owner:  anonymous 
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.7.1     
 Severity:  normal        |    Keywords:  usermeta  
--------------------------+-------------------------------------------------
 The following code, line 535ish of wp-includes/user.php

 {{{
 $metavalues = $wpdb->get_results($wpdb->prepare("SELECT meta_key,
 meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user->ID));
 $wpdb->show_errors($show);

 if ( $metavalues ) {
     foreach ( (array) $metavalues as $meta ) {
         $value = maybe_unserialize($meta->meta_value);
         $user->{$meta->meta_key} = $value;
     }
 }
 }}}

 This does not work for meta keys that have multiple values.  Right now
 get_usermeta doesn't act according to spec because this fills the cache it
 pulls from.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/9253>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list