[buddypress-trac] [BuddyPress] #2207: Login with capital letters on registration

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Tue Jul 27 23:08:11 UTC 2010


#2207: Login with capital letters on registration
----------------------+-----------------------------------------------------
 Reporter:  motomac   |       Owner:                              
     Type:  defect    |      Status:  new                         
 Priority:  major     |   Milestone:  1.3                         
Component:  XProfile  |    Keywords:  registration, capital letter
----------------------+-----------------------------------------------------

Comment(by r-a-y):

 sanitize_user() appears to be the blocker.  It's utilized in
 validate_user() and there's a bunch of weird things happening in
 sanitize_user().  Will need to look into this.

 This will work in the meantime.  Add this to your theme's functions.php:

 {{{
 function my_sanitize_user( $username, $raw_username, $strict ) {
         $username = $raw_username;
         $username = wp_strip_all_tags( $username );
         $username = remove_accents( $username );
         // Kill octets
         $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '',
 $username );
         $username = preg_replace( '/&.+?;/', '', $username ); // Kill
 entities

         // If strict, reduce to ASCII for max portability.
         if ( $strict )
                 $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '',
 $username );

         // Consolidate contiguous whitespace
         $username = preg_replace( '|\s+|', ' ', $username );

         return $username;
 }
 add_filter( 'sanitize_user', 'my_sanitize_user', 100, 3 );
 }}}

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2207#comment:5>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list