Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/05/2013 03:29:56 AM (12 years ago)
Author:
boonebgorges
Message:

Provide more specific feedback for username errors during registration

  • Distinguish between usernames that contain invalid characters and those that are blacklisted
  • Provide a more accurate list of characters allowed in usernames

Fixes #4939

Props hnla

File:
1 edited

Legend:

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

    r7119 r7163  
    11391139    $illegal_names = get_site_option( 'illegal_names' );
    11401140
    1141     if ( !validate_username( $user_name ) || in_array( $user_name, (array) $illegal_names ) )
    1142         $errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
     1141    if ( in_array( $user_name, (array) $illegal_names ) )
     1142        $errors->add( 'user_name', __( 'That username is not allowed', 'buddypress' ) );
     1143
     1144    if ( ! validate_username( $user_name ) )
     1145        $errors->add( 'user_name', __( 'Usernames can contain only letters, numbers, ., -, *, and @', 'buddypress' ) );
    11431146
    11441147    if( strlen( $user_name ) < 4 )
Note: See TracChangeset for help on using the changeset viewer.