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.

username character limit

edited September 2011 in Vanilla 2.0 - 2.8
How can I change the username character limit from 20 to something higher than that?

Thanks!
Tagged:

Best Answers

  • lucluc ✭✭
    Answer ✓
    @Lincoln: it was added only at 2011-05-31, so he should need to run at least 2.0.18b2

    6dde25fc (Tim 'Thunderpuncher' Gunter 2011-05-31 11:23:44 -0400 126) C("Garden.User.ValidationLength","{3,20}"));
  • LincLinc Admin
    Answer ✓
    I recommend doing 2 things then: 1) Add that to your config with the new values anyway and 2) Fixing it in /library/core/functions.validation.php in the ValidateUsernameRegex function (just search the file for "3,20").

    That way when you upgrade it will overwrite your hack in #2 and replace it with the new one that uses the config setting.

Answers

  • Add this to your config.php

    $Configuration['Garden']['User']['ValidationLength'] = '{3,20}';

    where 3 is the minimum length and 20 is the max length. Modify as desired.
  • lucluc ✭✭
    Answer ✓
    @Lincoln: it was added only at 2011-05-31, so he should need to run at least 2.0.18b2

    6dde25fc (Tim 'Thunderpuncher' Gunter 2011-05-31 11:23:44 -0400 126) C("Garden.User.ValidationLength","{3,20}"));
  • LincLinc Admin
    Answer ✓
    I recommend doing 2 things then: 1) Add that to your config with the new values anyway and 2) Fixing it in /library/core/functions.validation.php in the ValidateUsernameRegex function (just search the file for "3,20").

    That way when you upgrade it will overwrite your hack in #2 and replace it with the new one that uses the config setting.
  • Thanks a ton guys! It worked perfectly :)
Sign In or Register to comment.