Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #28435


Ignore:
Timestamp:
06/03/2014 04:58:44 AM (9 years ago)
Author:
rmccue
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28435

    • Property Summary changed from wp_insert_user/wp_update_user break when passed WP_User instance to wp_update_user breaks when passed WP_User instance
  • Ticket #28435 – Description

    initial v1  
    11Supposedly fixed in #21429. (Tangential to #28019)
    22
    3 If you pass a `WP_User` instance to `wp_update_user` or `wp_insert_user`, it first calls `WP_User::to_array`, which returns the user data from the DB. This is then treated as the input data.
     3If you pass a `WP_User` instance to `wp_update_user`, it first calls `WP_User::to_array`, which returns the user data from the DB. This is then treated as the input data.
    44
    55The problem then is that `$userdata['user_pass']` is '''always''' set, as it's always included in `$userdata`. This then gets double-hashed by `wp_update_user`. (`wp_update_user` will then update the cookies, so the user won't notice until they're logged out)
     
    2929
    3030This operation should have been a no-op, but isn't.
     31
     32(Ticket previously stated this happens with `wp_insert_user`; this is incorrect, as `wp_insert_user` doesn't hash the password for updates.)