mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Fixed problem with static Pattern object.
This commit is contained in:
parent
8b37d0b989
commit
300ac022cb
1 changed files with 5 additions and 6 deletions
|
@ -55,10 +55,8 @@ import org.jboss.remoting.callback.InvokerCallbackHandler;
|
||||||
public class Session {
|
public class Session {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(Session.class);
|
private static final Logger logger = Logger.getLogger(Session.class);
|
||||||
private static Pattern invalidUserNamePattern =
|
private final static Pattern alphabetsPattern = Pattern.compile("[a-zA-Z]");
|
||||||
Pattern.compile(ConfigSettings.getInstance().getInvalidUserNamePattern(), Pattern.CASE_INSENSITIVE);
|
private final static Pattern digitsPattern = Pattern.compile("[0-9]");
|
||||||
private static Pattern alphabetsPattern = Pattern.compile("[a-zA-Z]");
|
|
||||||
private static Pattern digitsPattern = Pattern.compile("[0-9]");
|
|
||||||
|
|
||||||
private final String sessionId;
|
private final String sessionId;
|
||||||
private UUID userId;
|
private UUID userId;
|
||||||
|
@ -122,6 +120,7 @@ public class Session {
|
||||||
if (userName.length() > config.getMaxUserNameLength()) {
|
if (userName.length() > config.getMaxUserNameLength()) {
|
||||||
return "User name may not be longer than " + config.getMaxUserNameLength() + " characters";
|
return "User name may not be longer than " + config.getMaxUserNameLength() + " characters";
|
||||||
}
|
}
|
||||||
|
Pattern invalidUserNamePattern = Pattern.compile(ConfigSettings.getInstance().getInvalidUserNamePattern(), Pattern.CASE_INSENSITIVE);
|
||||||
Matcher m = invalidUserNamePattern.matcher(userName);
|
Matcher m = invalidUserNamePattern.matcher(userName);
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";
|
return "User name '" + userName + "' includes not allowed characters: use a-z, A-Z and 0-9";
|
||||||
|
|
Loading…
Reference in a new issue