aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorJerome Bakker <jeabakker@coldtrick.com>2012-04-18 15:19:34 +0200
committerJerome Bakker <jeabakker@coldtrick.com>2012-04-18 15:19:34 +0200
commit88f1e8307f9a83b506ecae2e013125389310fed6 (patch)
tree95410fef1d6f7a0a57dd2a87234e254d6f04ba7e /engine/lib
parentf2a80038cddec5ed86b3dd9edb31cf07e3376de8 (diff)
downloadelgg-88f1e8307f9a83b506ecae2e013125389310fed6.tar.gz
elgg-88f1e8307f9a83b506ecae2e013125389310fed6.tar.bz2
fixes #4406: validate username for max chars
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/users.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index f1d42e25e..79a054938 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 = '/[' .