Skip to content

Commit 882625a

Browse files
author
Ubuntu
committed
Added a check for username length
1 parent fac9bdf commit 882625a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/add/user/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
$pw_len = strlen($_POST['v_password']);
5151
if ($pw_len < 6 ) $_SESSION['error_msg'] = __('Password is too short.',$error_msg);
5252
}
53+
// Check username length
54+
if (empty($_SESSION['error_msg'])) {
55+
$username_len = strlen($_POST['v_username']);
56+
if ($username_len > 12) $_SESSION['error_msg'] = __('Username is too long. Maximum 12 characters', $error_msg);
57+
}
5358

5459
// Protect input
5560
$v_username = escapeshellarg($_POST['v_username']);

0 commit comments

Comments
 (0)