[buddypress-trac] [BuddyPress] #4622: Spaces allowed in screen names since 1.6 update

buddypress-trac noreply at wordpress.org
Wed Oct 24 11:16:17 UTC 2012


#4622: Spaces allowed in screen names since 1.6 update
------------------------------+------------------
 Reporter:  oceanwidedesigns  |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  1.7
Component:  Members           |     Version:  1.6
 Severity:  normal            |  Resolution:
 Keywords:  dev-feedback      |
------------------------------+------------------

Comment (by boonebgorges):

 > Is there any way this can be worked around until there's an actual fix?

 To prevent the conversion of spaces to hyphens:
 {{{
 remove_action( 'pre_user_login', 'bp_core_strip_username_spaces' );
 }}}

 To keep the conversion in place but throw an error during registration
 when someone attempts to create a user with spaces in the username, a
 quick and dirty fix is:

 {{{
 function bp_4622_check_for_spaces_at_registration( $valid, $username ) {
     if ( false !== strpos( $username, ' ' ) ) {
         $valid = false;
     }
     return $valid;
 }
 add_filter( 'validate_username',
 'bp_4622_check_for_spaces_at_registration', 10, 2 );
 }}}

 Haven't tested it, but it should result in the "Only lowercase letters and
 numbers allowed" error being thrown.

 > We could add the username to the 'activate your account' email.

 These seems like a sensible thing to do, regardless of how the username
 validation stuff is resolved.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4622#comment:8>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list