Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/20/2022 05:59:15 PM (4 years ago)
Author:
imath
Message:

Make sure member has a type before trying to remove one

Avoid a PHP Type error if the member has no member types and the Administrator (or more probably a plugin) tries to remove it.

Props sx1001

See #8639 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-functions.php

    r13189 r13239  
    31663166    // No need to continue if the member doesn't have the type.
    31673167    $existing_types = bp_get_member_type( $user_id, false );
    3168     if ( ! in_array( $member_type, $existing_types, true ) ) {
     3168    if ( ! is_array( $existing_types ) || ! in_array( $member_type, $existing_types, true ) ) {
    31693169        return false;
    31703170    }
Note: See TracChangeset for help on using the changeset viewer.