diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-06-02 13:04:48 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-06-02 13:04:48 -0700 |
commit | d7a43c6ab26dc28c3b3c88bcede44d75a3f4a4fe (patch) | |
tree | 0ee2c336e9953a100c56764ef1e604d9b2b0ab86 /engine/lib/users.php | |
parent | 09d1daf77665f989c5f8e77be46fb5b378f3bce7 (diff) | |
parent | 88f1e8307f9a83b506ecae2e013125389310fed6 (diff) | |
download | elgg-d7a43c6ab26dc28c3b3c88bcede44d75a3f4a4fe.tar.gz elgg-d7a43c6ab26dc28c3b3c88bcede44d75a3f4a4fe.tar.bz2 |
Merge pull request #193 from jeabakker/#4406
#4406: validate username for max chars
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r-- | engine/lib/users.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index 7d427e743..241b524f9 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -810,6 +810,12 @@ function validate_username($username) { $msg = elgg_echo('registration:usernametooshort', array($CONFIG->minusername)); throw new RegistrationException($msg); } + + // username in the database has a limit of 128 characters + if (strlen($username) > 128) { + $msg = elgg_echo('registration:usernametoolong', array(128)); + throw new RegistrationException($msg); + } // Blacklist for bad characters (partially nicked from mediawiki) $blacklist = '/[' . |