Project

General

Profile

« Previous | Next » 

Revision 51678

Added by Sofia Baltzi over 6 years ago

Escape chars in regular expession for username

View differences:

modules/dnet-openaire-users/trunk/src/main/java/eu/dnetlib/openaire/usermanagement/RegisterServlet.java
63 63

  
64 64
            try {
65 65

  
66
                 if (username.matches("^[a-zA-Z0-9._-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)
66
                 if (username.matches("^[a-zA-Z0-9\\.\\_\\-]{4,150}") && !ldapActions.usernameExists(username) && !ldapActions.emailExists(email)
67 67
                         && !ldapActions.isZombieUsersEmail(email) && !ldapActions.isZombieUsersUsername(username)) {
68 68

  
69 69
                     ldapActions.createZombieUser(username, email, firstName, lastName, organization, password);
......
102 102

  
103 103
                 } else {
104 104

  
105
                     if(!username.matches("^[a-zA-Z0-9._-]{4,150}")) {
105
                     if(!username.matches("^[a-zA-Z0-9\\.\\_\\-]{4,150}")) {
106 106

  
107 107
                         if (username.length() < 5) {
108 108
                             request.getSession().setAttribute("username_message", "Minimum username length 5 characters.");

Also available in: Unified diff