Skip to content

Commit

Permalink
new hint validation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 10, 2023
1 parent 97e2161 commit 310f621
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ public void validate(IValidatable<String> validatable) {
}

private boolean hintEqualsOrSimilarToPassword(@NotNull String password, @NotNull String hint) {
return password.equals(hint) || password.contains(hint.trim().replaceAll(" ", ""))
|| hint.contains(password);
String passwordWithoutSpacesValue = password.trim().replaceAll(" ", "");
String hintWithoutSpacesValue = hint.trim().replaceAll(" ", "");
return passwordWithoutSpacesValue.contains(hintWithoutSpacesValue)
|| hintWithoutSpacesValue.contains(passwordWithoutSpacesValue);
}
}

Expand Down

0 comments on commit 310f621

Please sign in to comment.