Lots of previous threads for this. Even a recent one with a Trac ticket to make it so it doesn’t require lowercase:
https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/register-username-with-uppercase/
https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/allowing-users-to-type-in-uppercase-letters-for-the-username/
https://buddypress.org/community/groups/installing-buddypress/forum/topic/username-starts-from-uppercase-letter/
I’m not sure if the lowercase does matter in other sections. You might add the question to the Trac ticket and see if the core developers can answer. This is something I’d like to fix too. The other solution I’ve considered is to have some javascript function that will check the username to make sure 1. it’s available and 2. that it’s lowercase and 3. Any other validation. At least a notification before they click submit would be sufficient.
Thanks for the reply – indeed I will try the Track ticket
Hi!
Does anyone have a solution for this problem? Is it possible to be allowed in capital letters in usernames? All the Links on Google and buddypress.org doesn´t help…
I have tryed out a few things… For example, I’ve replaced in the bp-core-signup.php on line 321
preg_match( "/[a-z0-9]+/", $user_name, $maybe );
with
preg_match( "/[a-zA-Z0-9öäüÖÄÜß]+/", $user_name, $maybe );
In line 327 an error message is generated when the user name does not comply with certain criteria.
if ( !validate_username( $user_name, $strict = false ) || in_array( $user_name, (array)$illegal_names ) || $user_name != $maybe[0] )
$errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
When I comment out followed code in Line 327:
!validate_username( $user_name, $strict = false ) ||
my preg_match rule works with the capital letters and special characters, but I think that will later have an impact on the log on and other things.
Capital letters are now being accepted, but no special characters such as “ßöüÖ” … -.-
validate_username() is a WordPress function
https://codex.wordpress.org/Function_Reference/validate_username
and it uses
sanitize_user() which is documented here:
https://codex.wordpress.org/Function_Reference/sanitize_user
Has anyone any idea how to do this without an sql injection or incompatible usernames later?
I would have liked that a user can log in as “SteffanieKönig” …
When we get together at a solution I would like to summarize the whole issue and as a plugin, but I’m at the end of my knowledge! -.-
SickSight
Maybe someone has an idea?
@sicksight
You should update this trac ticket with what you’ve tried: https://trac.buddypress.org/ticket/2207 I assume that’s where you got the code to try.
You can log into trac with the same user you log in to this forum with.
Thanks @crashutah ! I would do this!