WordPress.org

Make WordPress Core

Changeset 23380


Ignore:
Timestamp:
02/02/2013 04:41:02 AM (9 years ago)
Author:
nacin
Message:

Confirm a user exists before deleting them in wp_delete_user() and wpmu_delete_user(). props scribu, fixes #23067.

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r22840 r23380  
    135135    $id = (int) $id;
    136136    $user = new WP_User( $id );
     137
     138    if ( !$user->exists() )
     139        return false;
    137140
    138141    do_action( 'wpmu_delete_user', $id );
  • trunk/wp-admin/includes/user.php

    r22124 r23380  
    241241    $user = new WP_User( $id );
    242242
     243    if ( !$user->exists() )
     244        return false;
     245
    243246    // allow for transaction statement
    244247    do_action('delete_user', $id);
Note: See TracChangeset for help on using the changeset viewer.