Skip to:
Content

BuddyPress.org

Changeset 13597


Ignore:
Timestamp:
10/17/2023 05:03:38 PM (12 months ago)
Author:
imath
Message:

Groups/Members block PHP callbacks: only allow supported avatar sizes

If the avatarSize property transported into the PHP render callbacks for the bp/members and bp/groups blocks is not set to "full" or "thumb", reset this property to "none".

Fix applied to Branch 11.0.

Location:
branches/11.0/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/11.0/src/bp-groups/bp-groups-blocks.php

    r13296 r13597  
    206206    if ( ! array_filter( $group_ids ) ) {
    207207        return '';
     208    }
     209
     210    // Make sure the avatar size exists.
     211    if ( ! in_array( $block_args['avatarSize'], array( 'thumb', 'full' ), true ) ) {
     212        $block_args['avatarSize'] = 'none';
    208213    }
    209214
  • branches/11.0/src/bp-members/bp-members-blocks.php

    r13296 r13597  
    197197    if ( ! array_filter( $member_ids ) ) {
    198198        return '';
     199    }
     200
     201    // Make sure the avatar size exists.
     202    if ( ! in_array( $block_args['avatarSize'], array( 'thumb', 'full' ), true ) ) {
     203        $block_args['avatarSize'] = 'none';
    199204    }
    200205
Note: See TracChangeset for help on using the changeset viewer.