Make WordPress Core

Changeset 12511


Ignore:
Timestamp:
12/23/2009 03:02:06 PM (14 years ago)
Author:
ryan
Message:

Sanitize only string and numeric fields in the user object. Props filosofo hakre. fixes #11509 for trunk

File:
1 edited

Legend:

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

    r12300 r12511  
    639639            $vars = get_object_vars($user);
    640640        foreach ( array_keys($vars) as $field ) {
    641             if ( is_array($user->$field) )
    642                 continue;
    643             $user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
     641            if ( is_string($user->$field) || is_numeric($user->$field) )
     642                $user->$field = sanitize_user_field($field, $user->$field, $user->ID, $context);
    644643        }
    645644        $user->filter = $context;
     
    690689        return $value;
    691690
    692     if ( is_array($value) )
     691    if ( !is_string($value) && !is_numeric($value) )
    693692        return $value;
    694693
Note: See TracChangeset for help on using the changeset viewer.