Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#9253 closed defect (bug) (duplicate)

_fill_user does not handle multi-value usermeta keys properly

Reported by: bkrausz Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: General Keywords: usermeta
Focuses: Cc:


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));

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.

Change History (2)

13 years ago

  • Milestone changed from Unassigned to 2.8

#2 @ryan
12 years ago

  • Milestone 2.8 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Tracking this with #7540

Note: See TracTickets for help on using tickets.