Skip to content

Commit

Permalink
Increase domain TLD max length check
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugmatt committed Mar 30, 2021
1 parent ce07489 commit 57474e2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public boolean handle(ModalFormResponsePacket packet) {
session.sendPacketImmediately(UIForms.createError("Address is too large. (Must be less than 253)"));
else if(data.get(1).length() >= 10)
session.sendPacketImmediately(UIForms.createError("Port is too large. (Must be less than 10)"));
else if (!data.get(0).matches("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$") && !data.get(0).matches("^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$"))
else if (!data.get(0).matches("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$") && !data.get(0).matches("^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,64}$"))
session.sendPacketImmediately(UIForms.createError("Enter a valid address. (E.g. play.example.net, 172.16.254.1)"));
else if (!data.get(1).matches("[0-9]+"))
session.sendPacketImmediately(UIForms.createError("Enter a valid port that contains only numbers"));
Expand Down

0 comments on commit 57474e2

Please sign in to comment.