Commit 2d1795bb authored by Gabriel Guardincerri's avatar Gabriel Guardincerri Committed by gguardin

[JM-1400] Be less strict with emails when loading a user. To be reviewed by Gato

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10579 b35dd754-fafc-0310-a699-88a17e54d16e
parent cb24188f
......@@ -132,12 +132,12 @@ public class User implements Cacheable, Externalizable, Result {
throw new NullPointerException("Username cannot be null");
}
this.username = username;
if (UserManager.getUserProvider().isNameRequired() && (name == null || name.equals(""))) {
if (UserManager.getUserProvider().isNameRequired() && (name == null || "".equals(name.trim()))) {
throw new IllegalArgumentException("Invalid or empty name specified with provider that requires name");
}
this.name = name;
if (UserManager.getUserProvider().isEmailRequired() && !StringUtils.isValidEmailAddress(email)) {
throw new IllegalArgumentException("Invalid or empty email address specified with provider that requires email address. User: "
if (UserManager.getUserProvider().isEmailRequired() && (email == null || "".equals(email.trim()))) {
throw new IllegalArgumentException("Empty email address specified with provider that requires email address. User: "
+ username + " Email: " + email);
}
this.email = email;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment