summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/userservice.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/userservice.php b/services/userservice.php
index ad79d34..fa0d5c9 100644
--- a/services/userservice.php
+++ b/services/userservice.php
@@ -445,7 +445,9 @@ class UserService {
}
function isValidUsername($username) {
- if (strlen($username) > 24) {
+ if (strlen($username) < 4) {
+ return false;
+ }elseif (strlen($username) > 24) {
// too long usernames are cut by database and may cause bugs when compared
return false;
} elseif (preg_match('/(\W)/', $username) > 0) {