Escape chars in regular expession for username
This commit is contained in:
parent
ba055250a0
commit
05eaa29b73
|
@ -63,7 +63,7 @@ public class RegisterServlet extends HttpServlet {
|
|||
|
||||
try {
|
||||
|
||||
if (username.matches("^[a-zA-Z0-9._-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)
|
||||
if (username.matches("^[a-zA-Z0-9\\.\\_\\-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)
|
||||
&& !ldapActions.isZombieUsersEmail(email) && !ldapActions.isZombieUsersUsername(username)) {
|
||||
|
||||
ldapActions.createZombieUser(username, email, firstName, lastName, organization, password);
|
||||
|
@ -102,7 +102,7 @@ public class RegisterServlet extends HttpServlet {
|
|||
|
||||
} else {
|
||||
|
||||
if(!username.matches("^[a-zA-Z0-9._-]{4,150}")) {
|
||||
if(!username.matches("^[a-zA-Z0-9\\.\\_\\-]{4,150}")) {
|
||||
|
||||
if (username.length() < 5) {
|
||||
request.getSession().setAttribute("username_message", "Minimum username length 5 characters.");
|
||||
|
|
Loading…
Reference in New Issue