WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/06/2008 08:31:54 PM (13 years ago)
Author:
markjaquith
Message:

Cast to array when using foreach(). Props santosj (and thanks for your perseverance!). fixes #2784

File:
1 edited

Legend:

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

    r8069 r8572  
    287287            $output .= "\t<option value='-1'>$show_option_none</option>\n";
    288288
    289         foreach ( $users as $user ) {
     289        foreach ( (array) $users as $user ) {
    290290            $user->ID = (int) $user->ID;
    291291            $_selected = $user->ID == $selected ? " selected='selected'" : '';
     
    312312
    313313    if ( $metavalues ) {
    314         foreach ( $metavalues as $meta ) {
     314        foreach ( (array) $metavalues as $meta ) {
    315315            $value = maybe_unserialize($meta->meta_value);
    316316            $user->{$meta->meta_key} = $value;
Note: See TracChangeset for help on using the changeset viewer.