[wp-trac] [WordPress Trac] #53627: Return earlier from wp_update_user() in case of error

WordPress Trac noreply at wordpress.org
Thu Jul 8 16:14:37 UTC 2021


#53627: Return earlier from wp_update_user() in case of error
----------------------------+--------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.9
Component:  Users           |    Version:  4.3
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+--------------------
 In `wp_update_user()`, there's an `is_wp_error()` check after the
 `wp_insert_user()` call.

 However, before an error is returned, some additional code runs to update
 the cookies if the password for the current user has changed.

 If the `wp_insert_user()` call resulted in an error, it seems better and
 more predictable to return it right away without any further actions.

 Introduced in [32820].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53627>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list