Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Use non-Engish characters in username field. Is it possible?

edited July 2011 in Vanilla 2.0 - 2.8
hi,

Can i change the system so it accepts letters in username field other than English? At the moment if I enter username in non-English characters it gives me a standard error message: "User name can only contain letters, numbers, underscores etc".....and does not allow to register.
I have database set up in UTF8-unicode.

thank you.

Answers

  • TimTim Operations Vanilla Staff
    If you wait until Vanilla 2.0.18, we've moved the regular expression for validating usernames into the config file, making it much easier to modify the list of characters you choose to accept. We haven't bulletproofed the rest of the code much yet, but you can still experiment.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • I am having problems upgrading to 2.0.18. No chance to do it on 2.0.17?
  • lucluc ✭✭
    Nope.
  • @berdia
    See this thread for 2.0.17 or before.

    @Tim
    By any chance do you move the regular expression into the locale file instead of config file?
    Because;
    1. In many cases, the request like this comes from the user who uses non-English locale. So, if locale file can include the regex pattern for ValidateUsername() function, many users will be satisfied by enabling locale pack without editing conf.
    2. If we change the regex pattern for validate username, we may also want to change some translation code like this.
    $Definition['UsernameError'] = 'Username can only contain letters, numbers, underscores, and must be between 3 and 20 characters long.';
    It's better to change just 1 file than 2 files.

    and,
    3. I think the regex patterns should be together in one place for ValidateUsername(), Mentions() (for @mentions and for #hashtag) and GetMentions(). All of changes for them have just one purpose. To re-define valid characters for their locale.
  • I see the solution for the 'spaces in the name' issue in the thread mentioned above, but cannot see the solution for using non-Engish characters in username field in @mentions. Could you guys advise? Thanks
  • I like this idea
  • @Csabbencs
    Back to the discussion and search "// Handle @mentions".
    Also you'd better to check the discussion [Simplified Chinese Locale Addon] 中文用户名解决方案.
  • @yu_tang
    The first discussion and the handle mentions part you mention covers only the 'space' issue, not the 'non-Engish characters' issue.
    I found the answer in the Chinese discussion you mention. Though, I don't understand a single word of it, the expression '/(^|[\s,\.])@([\S]{1,20})(?=[\s,\.!?]|$)/i', solves my problem for the time being.

    These solutions are all workarounds, though.
    In my opinion, when mentioning, a colon (:) should be put to the end of the mentioned username and then the part between @ and : (colon) could be taken, something like "@hello, this is me: I can see that is you".
    A user should be allowed to take a username whatever he/she wants, restrict the user right at the very beginning when trying to register at your forum is the worst you can do. Later on, they will come to their own decision anyway to change it when they find they are unable to connect to facebook, twitter, etc...
  • The first discussion and the handle mentions part you mention covers only the 'space' issue, not the 'non-Engish characters' issue.
    Of course, it shows how to change the pattern. It's up to you to change it to what.
  • Upgrade to Version 2.0.18b2 solved the problem.
  • And when will Version 2.0.18b2 b out of beta ? Cause like others, am having problems upgrading. ?
  • No idea to be honest but I am using it and it's so far so good.
  • If you wait until Vanilla 2.0.18, we've moved the regular expression for validating usernames into the config file, making it much easier to modify the list of characters you choose to accept. We haven't bulletproofed the rest of the code much yet, but you can still experiment.
    thanks for the update tim. i have installed vanilla 2.0.18 beta 2 but i don't see which part of the config file where we can modify the list of characters we choose to accept. can you provide more details?

    i'm currently trying to enable chinese username support and hope we can resolve this shortly. i really like vanilla forums and see a lot of potential in it, but support for non-english characters in usernames is a must for us. thanks!
  • lucluc ✭✭
    It was changed after beta2.
  • It was changed after beta2.
    thanks for the response luc. any details on when we can expect to see non-english based usernames supported?

Sign In or Register to comment.