Skip to content

Commit

Permalink
Fix patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyberkovitz committed Apr 22, 2020
1 parent ff28624 commit 4d66fc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void validateAddr(Address address)
}

public void checkName(String name) throws InvalidAddrNameException {
if (!name.matches("(\\p{IsLatin}|[0-9 ])*$")) {
if (!name.matches("([a-zA-Z0-9 \\\"\\;\\:\\'\\?\\/\\<\\>\\,\\{\\}\\[\\]\\(\\)\\!\\@\\#\\$\\%\\^\\&\\*\\-\\_=+])*$")) {
throw new InvalidAddrNameException("Name must only include alphanumeric characters.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void deleteRestaurant(int rest_id) throws AddressManager.InvalidAddressId
}

public void checkName(String name) throws InvalidRestNameException {
if (!name.matches("(\\p{IsLatin}|[0-9 ])*$")) {
if (!name.matches("([a-zA-Z0-9 \\\"\\;\\:\\'\\?\\/\\<\\>\\,\\{\\}\\[\\]\\(\\)\\!\\@\\#\\$\\%\\^\\&\\*\\-\\_=+])*$")) {
throw new InvalidRestNameException("Name must only include alphanumeric characters.");
}
}
Expand Down

0 comments on commit 4d66fc5

Please sign in to comment.