Skip to:
Content

BuddyPress.org

Changeset 12694


Ignore:
Timestamp:
07/29/2020 06:44:23 PM (6 months ago)
Author:
boonebgorges
Message:

Remove terms blacklist and whitelist in inline comments and local variables.

The change is in order to promote clearer and more inclusive language.

See #8339.

Location:
trunk/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-admin.php

    r12664 r12694  
    396396                case 'ham' :
    397397                    /**
    398                      * Remove moderation and blacklist checks in case we want to ham an activity
     398                     * Remove moderation and disallowed keyword checks in case we want to ham an activity
    399399                     * which contains one of these listed keys.
    400400                     */
  • trunk/src/bp-activity/bp-activity-filters.php

    r12542 r12694  
    171171
    172172/**
    173  * Mark the posted activity as spam, if it contains blacklist keywords.
     173 * Mark the posted activity as spam, if it contains disallowed keywords.
    174174 *
    175175 * @since 1.6.0
  • trunk/src/bp-activity/bp-activity-functions.php

    r12605 r12694  
    848848 * The "context" is the current view type, corresponding roughly to the
    849849 * current component. Use this context to determine which activity actions
    850  * should be whitelisted for the filter dropdown.
     850 * should be permitted in the filter dropdown.
    851851 *
    852852 * @since 2.8.0
     
    41444144    }
    41454145
    4146     // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated.
     4146    // Add "new_post_type_comment" to the allowed activity types, so that the activity's Akismet history is generated.
    41474147    $post_type_comment_action = $activity_comment_object->action_id;
    41484148    $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) {
     
    41624162    add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
    41634163
    4164     // Remove the "new_blog_comment" activity type whitelist so we don't break anything.
     4164    // Remove the dynamic permitting of the "new_blog_comment" activity type so we don't break anything.
    41654165    remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
    41664166}
  • trunk/src/bp-activity/classes/class-bp-activity-query.php

    r11746 r12694  
    230230     * Validates a column name parameter.
    231231     *
    232      * Column names are checked against a whitelist of known tables.
     232     * Column names are checked against a list of known tables.
    233233     * See {@link BP_Activity_Query::db_tables}.
    234234     *
  • trunk/src/bp-activity/classes/class-bp-akismet.php

    r12586 r12694  
    563563        $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
    564564
    565         // Loop through _SERVER args and remove whitelisted keys.
     565        // Loop through _SERVER args and remove specified keys.
    566566        foreach ( $_SERVER as $key => $value ) {
    567567
  • trunk/src/bp-core/bp-core-functions.php

    r12691 r12694  
    516516        }
    517517
    518         // 'register' and 'activate' do not have components, but should be whitelisted.
     518        // 'register' and 'activate' do not have components, but are allowed as special cases.
    519519        if ( in_array( $component_name, array( 'register', 'activate' ), true ) ) {
    520520            continue;
  • trunk/src/bp-core/bp-core-moderation.php

    r11447 r12694  
    142142
    143143    // Get the moderation keys.
    144     $blacklist = trim( get_option( 'moderation_keys' ) );
    145 
    146     // Bail if blacklist is empty.
    147     if ( ! empty( $blacklist ) ) {
     144    $disallowed = trim( get_option( 'moderation_keys' ) );
     145
     146    // Bail if list is empty.
     147    if ( ! empty( $disallowed ) ) {
    148148
    149149        // Get words separated by new lines.
    150         $words = explode( "\n", $blacklist );
     150        $words = explode( "\n", $disallowed );
    151151
    152152        // Loop through words.
     
    227227
    228228    // Get the moderation keys.
    229     $blacklist = trim( get_option( 'blacklist_keys' ) );
    230 
    231     // Bail if blacklist is empty.
    232     if ( empty( $blacklist ) ) {
     229    $disallowed = get_option( 'disallowed_keys' );
     230
     231    // Support for WP < 5.5.
     232    if ( false === $disallowed ) {
     233        $disallowed = get_option( 'blacklist_keys' );
     234    }
     235
     236    $disallowed = trim( $disallowed );
     237
     238    // Bail if disallowed list is empty.
     239    if ( empty( $disallowed ) ) {
    233240        return true;
    234241    }
     
    263270
    264271    // Get words separated by new lines.
    265     $words = explode( "\n", $blacklist );
     272    $words = explode( "\n", $disallowed );
    266273
    267274    // Loop through words.
  • trunk/src/bp-core/classes/class-bp-user-query.php

    r12602 r12694  
    574574        ), $this ) );
    575575
    576         // We calculate total_users using a standalone query, except
    577         // when a whitelist of user_ids is passed to the constructor.
    578         // This clause covers the latter situation, and ensures that
    579         // pagination works when querying by $user_ids.
     576        /*
     577         * We calculate total_users using a standalone query, except
     578         * when a list of specific user_ids is passed to the constructor.
     579         * This clause covers the latter situation, and ensures that
     580         * pagination works when querying by $user_ids.
     581         */
    580582        if ( empty( $this->total_users ) ) {
    581583            $this->total_users = count( $wp_user_query->results );
  • trunk/src/bp-groups/bp-groups-functions.php

    r12605 r12694  
    416416
    417417/**
    418  * Check a group status (eg 'private') against the whitelist of registered statuses.
     418 * Check a group status (eg 'private') against the list of registered statuses.
    419419 *
    420420 * @since 1.1.0
  • trunk/src/bp-groups/screens/single/admin/group-settings.php

    r12381 r12694  
    2727        $enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
    2828
    29         // Checked against a whitelist for security.
     29        // Checked against a list of allowed statuses for security.
    3030        /** This filter is documented in bp-groups/bp-groups-admin.php */
    3131        $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
    3232        $status         = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
    3333
    34         // Checked against a whitelist for security.
     34        // Checked against a list of allowed statuses for security.
    3535        /** This filter is documented in bp-groups/bp-groups-admin.php */
    3636        $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
  • trunk/src/bp-members/bp-members-functions.php

    r12693 r12694  
    15881588 *   - Is the email address well-formed?
    15891589 *   - Is the email address already used?
    1590  *   - If there's an email domain blacklist, is the current domain on it?
     1590 *   - If there are disallowed email domains, is the current domain among them?
    15911591 *   - If there's an email domain whitelest, is the current domain on it?
    15921592 *
     
    17051705        }
    17061706
    1707         // User name can't be on the blacklist.
     1707        // User name can't be on the list of illegal names.
    17081708        $illegal_names = get_site_option( 'illegal_names' );
    17091709        if ( in_array( $user_name, (array) $illegal_names ) ) {
  • trunk/src/bp-members/classes/class-bp-signup.php

    r12635 r12694  
    122122     *
    123123     * @since 2.0.0
    124      * @since 6.0.0 Adds a whitelist of allowed orderby parameters.
     124     * @since 6.0.0 Added a list of allowed orderby parameters.
    125125     *
    126126     * @param array $args {
  • trunk/src/bp-settings/bp-settings-functions.php

    r12612 r12694  
    8282
    8383/**
    84  * Build a dynamic whitelist of notification keys, based on what's hooked to 'bp_notification_settings'.
     84 * Build a dynamic list of allowed notification keys, based on what's hooked to 'bp_notification_settings'.
    8585 *
    8686 * @since 2.3.5
     
    9292    ob_start();
    9393    /**
    94      * Fires at the start of the notification keys whitelisting.
     94     * Fires at the start of the building of the notification keys allowed list.
    9595     *
    9696     * @since 1.0.0
     
    102102
    103103    if ( $matched && isset( $matches[1] ) ) {
    104         $key_whitelist = $matches[1];
     104        $allowed_key_list = $matches[1];
    105105    } else {
    106         $key_whitelist = array();
    107     }
    108 
    109     return $key_whitelist;
     106        $allowed_key_list = array();
     107    }
     108
     109    return $allowed_key_list;
    110110}
    111111
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r12529 r12694  
    165165
    166166/**
    167  * Filters profile field values for whitelisted HTML.
     167 * Filters profile field values for allowed HTML.
    168168 *
    169169 * @since 5.0.0
     
    178178
    179179/**
    180  * Filters profile field values for whitelisted HTML, when coming from xprofile_get_field_data().
     180 * Filters profile field values for allowed HTML, when coming from xprofile_get_field_data().
    181181 *
    182182 * @since 5.0.0
     
    337337 *
    338338 * Most field values are simply run through esc_html(). Those that support rich text (by default, `textarea` only)
    339  * are sanitized using kses, which allows a whitelist of HTML tags.
     339 * are sanitized using kses, which allows HTML tags from a controlled list.
    340340 *
    341341 * @since 2.4.0
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r12605 r12694  
    208208 *     @type int    $field_group_id    ID of the associated field group.
    209209 *     @type int    $parent_id         Optional. ID of the parent field.
    210  *     @type string $type              Field type. Checked against a field_types whitelist.
     210 *     @type string $type              Field type. Checked against a list of allowed field_types.
    211211 *     @type string $name              Name of the new field.
    212212 *     @type string $description       Optional. Descriptive text for the field.
     
    453453    }
    454454
    455     // For certain fields, only certain parameters are acceptable, so add them to the whitelist.
     455    // For certain fields, only certain parameters are acceptable, so add them to the list of allowed values.
    456456    if ( $field_type_obj->supports_options ) {
    457457        $field_type_obj->set_whitelist_values( wp_list_pluck( $field->get_children(), 'name' ) );
     
    488488    }
    489489
    490     // Check against a whitelist.
     490    // Check against a list of registered visibility levels.
    491491    $allowed_values = bp_xprofile_get_visibility_levels();
    492492    if ( !array_key_exists( $visibility_level, $allowed_values ) ) {
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r12596 r12694  
    163163        $this->field_types = apply_filters( 'xprofile_field_types', array_keys( bp_xprofile_get_field_types() ) );
    164164
    165         // 'option' is a special case. It is not a top-level field, so
    166         // does not have an associated BP_XProfile_Field_Type class,
    167         // but it must be whitelisted.
     165        /*
     166         * 'option' is a special case. It is not a top-level field, so
     167         * does not have an associated BP_XProfile_Field_Type class,
     168         * but it must be explicitly allowed.
     169         */
    168170        $this->field_types[] = 'option';
    169171
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type.php

    r12529 r12694  
    2727
    2828    /**
    29      * Whitelisted values for field type.
    30      *
    31      * @since 2.0.0
    32      * @var array Field type whitelisted values.
     29     * Allowed values for field type.
     30     *
     31     * @since 2.0.0
     32     * @var array Field type allowed values.
    3333     */
    3434    protected $validation_whitelist = array();
     
    5959
    6060    /**
    61      * If this is set, BP will set this field type's validation whitelist from the field's options (e.g checkbox, selectbox).
     61     * If this is set, BP will set this field type's list of allowed values from the field's options (e.g checkbox, selectbox).
    6262     *
    6363     * @since 2.0.0
Note: See TracChangeset for help on using the changeset viewer.