Valid alphanumeric characters for usernames

What is the set of valid alphanumeric characters that can be used for usernames? It appears the @ symbol and therefore emails can’t be used?
Thanks

Hi Tieku,

According to /src/Forms/Input/username.php, the legal symbols are:

[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u3040-\u309F\u3400-\u4DBF\u4E00-\u9FFF\u2B740–\u2B81F0-9_\-\.]

Basically, a-z, A-Z, 0-9, _, -, . and (as far as I can tell) a few special account characters.

You could add @ to this list and it should work for you, but you’ll need to remake the change any time you upgrade Gibbon.

Cheers,

Ross

Thanks Ross. This answers my question and points me in the right direction.

I tried
[a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u3040-\u309F\u3400-\u4DBF\u4E00-\u9FFF\u2B740–\u2B81F0-9_\-\.\@]
but still getting Invalid value: … Contains invalid characters.

Looks like the Contains invalid characters error was not referring to invalid characters but to the username being longer than 20 characters. Interesting.

So the original /src/Forms/Input/username.php allows email addresses.

Hi Tieku, ah, that is interesting! Yes, some emails will definitely be longer than 20 characters, and so perhaps a good reason to avoid using them as usernames. Ross.

Hi Tieku, it may be useful to know that Gibbon already allows using email for logging in, so it’s ideally best to not then use the email for the username as well. If you’re importing users, it could be handy to strip out the part after and including the @ sign, to generate a username for that user.

Sandra that’s good to know (that Gibbon already allows using email for logging in). I just tried it. And it works automatically. Yes, that’s what I have in mind to use for the usernames.

Thanks