[wp-trac] [WordPress Trac] #22858: wp_update_user() does not check the return of get_userdata() before calling to_array()
WordPress Trac
noreply at wordpress.org
Mon Dec 17 21:26:03 UTC 2012
#22858: wp_update_user() does not check the return of get_userdata() before calling
to_array()
--------------------------+--------------------
Reporter: ryan | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.5.1
Component: Users | Version:
Severity: trivial | Resolution:
Keywords: |
--------------------------+--------------------
Comment (by nacin):
Replying to [comment:3 lukbarros]:
> You should check your implementation as quoted in attached diff. Close
this ticket that it does not proceed, will break several wp deployed when
someone atualiazr and have implemented waiting for the return as false on
failure.
Hi lukbarros, I think you're saying that if we use [attachment:user.diff],
it will break plugins that expect a return as false on failure, rather
than WP_Error. You have a point, for sure. But in this case,
wp_insert_user() can already return WP_Error, and because of that, so can
wp_update_user(). Both functions are documented to return a user ID on
success and WP_Error on failure, and that's exactly what occurs now.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22858#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list