Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/16/2017 08:00:41 PM (4 years ago)
Author:
boonebgorges
Message:

Members: Run BP's illegal user names through WP filter.

This ensures that user names added to the blacklist via the
'illegal_user_logins' filter are also blacklisted during BP registration.

Props espellcaste.
Fixes #7461.

File:
1 edited

Legend:

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

    r11705 r11747  
    15791579    $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array_merge( array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ), $bp_component_slugs ) );
    15801580
    1581     // Merge the arrays together.
    1582     $merged_names           = array_merge( (array) $filtered_illegal_names, (array) $db_illegal_names );
     1581    /**
     1582     * Filters the list of illegal usernames from WordPress.
     1583     *
     1584     * @since 3.0
     1585     *
     1586     * @param array Array of illegal usernames.
     1587     */
     1588    $wp_filtered_illegal_names = apply_filters( 'illegal_user_logins', array() );
     1589
     1590    // First merge BuddyPress illegal names.
     1591    $bp_merged_names           = array_merge( (array) $filtered_illegal_names, (array) $db_illegal_names );
     1592
     1593    // Then merge WordPress and BuddyPress illegal names.
     1594    $merged_names              = array_merge( (array) $wp_filtered_illegal_names, (array) $bp_merged_names );
    15831595
    15841596    // Remove duplicates.
    1585     $illegal_names          = array_unique( (array) $merged_names );
     1597    $illegal_names             = array_unique( (array) $merged_names );
    15861598
    15871599    /**
Note: See TracChangeset for help on using the changeset viewer.