[wp-trac] [WordPress Trac] #33800: wp_delete_user delete the user ID 1 if an object is passed in param

WordPress Trac noreply at wordpress.org
Thu Sep 10 10:29:16 UTC 2015


#33800: wp_delete_user delete the user ID 1 if an object is passed in param
--------------------------+------------------------------
 Reporter:  juliobox      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Users         |     Version:  2.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by dipesh.kakadiya):

 @utkarshpatel

 > So we can certainly not add a check for numeric and WP_User object only.
 Yeah i agree, it's developer mistake. But if developer missed to check
 wp_error the admin is deleted.

 I know WP_user it expects int(user_id), Object of WP_User or Object with
 ID as user_id but there are cast integer for `$id` in `wp_delete_user`

 `$id = (int) $id;`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33800#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list