|
@@ -137,6 +137,9 @@ class LuticateUsersBusiness extends LuBusiness {
|
137
|
137
|
$hash = self::hashPassword($password);
|
138
|
138
|
if (filter_var($username, FILTER_VALIDATE_EMAIL))
|
139
|
139
|
self::badInput("Username can not be an email");
|
|
140
|
+ if (!preg_match("/^[A-Za-z0-9\\-_\\.]$/", $username)) {
|
|
141
|
+ self::badInput("Username can only contain letters (A-Z a-z), numbers (0-9), hyphen (-), underscore (_) and dot (.)");
|
|
142
|
+ }
|
140
|
143
|
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
|
141
|
144
|
self::badInput("Invalid email address");
|
142
|
145
|
$user = LuticateUsersDataAccess::getByUsernameOrEmail($username);
|