Skip to content

Commit

Permalink
[WFCORE-3087] Ensure that attempting to add a username with accented …
Browse files Browse the repository at this point in the history
…characters results in an error
  • Loading branch information
fjuma committed Jul 21, 2017
1 parent 577d26c commit 500be7e
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -94,7 +94,7 @@ private State getValidCharactersState() {
public State execute() {
for (char currentChar : stateValues.getUserName().toCharArray()) {
if ((!isValidPunctuation(currentChar))
&& (Character.isLetter(currentChar) || Character.isDigit(currentChar)) == false) {
&& (isValidLetter(currentChar) || Character.isDigit(currentChar)) == false) {
return new ErrorState(theConsole, DomainManagementLogger.ROOT_LOGGER.usernameNotAlphaNumeric(VALID_SYMBOLS), getRetryState(), stateValues);
}
}
Expand All @@ -105,6 +105,10 @@ public State execute() {
private boolean isValidPunctuation(char currentChar) {
return (Arrays.binarySearch(VALID_PUNCTUATION, currentChar) >= 0);
}

private boolean isValidLetter(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
};
}

Expand Down

0 comments on commit 500be7e

Please sign in to comment.