Make WordPress Core

Ticket #33800: 33800_2.diff

File 33800_2.diff, 459 bytes (added by dipesh.kakadiya, 9 years ago)

Remove cast Intefer & add check for integer & wp_user object

  • src/wp-admin/includes/user.php

     
    273273function wp_delete_user( $id, $reassign = null ) {
    274274        global $wpdb;
    275275
    276         $id = (int) $id;
     276        if ( ! is_numeric( $id ) && ! $id instanceof WP_User  ){
     277                return false;
     278        }
     279
    277280        $user = new WP_User( $id );
    278281
    279282        if ( !$user->exists() )