Fixed league preview not checking/enforcing that the event name is <= the database limit of 45 characters.

This commit is contained in:
Christian 'ketura' McCarty
2025-04-01 17:20:04 -05:00
parent b1abddbce5
commit 2662e5a260

View File

@@ -473,6 +473,7 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
List<String> maxMatchesStr = getFormMultipleParametersSafely(postDecoder, "maxMatches[]");
Throw400IfStringNull("name", name);
Throw400IfValidationFails("name", name, name.length() > 45, "League name must be 45 characters or less.");
int cost = Throw400IfNullOrNonInteger("cost", costStr);
if(startStr.length() != 8)
throw new HttpProcessingException(400, "Parameter 'start' must be exactly 8 digits long: YYYYMMDD");
@@ -628,6 +629,7 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
Throw400IfStringNull("name", name);
Throw400IfValidationFails("name", name, name.length() > 45, "League name must be 45 characters or less.");
int cost = Throw400IfNullOrNonInteger("cost", costStr);
if(startStr.length() != 8)
throw new HttpProcessingException(400, "Parameter 'start' must be exactly 8 digits long: YYYYMMDD");
@@ -778,6 +780,7 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
Throw400IfStringNull("name", name);
Throw400IfValidationFails("name", name, name.length() > 45, "League name must be 45 characters or less.");
int cost = Throw400IfNullOrNonInteger("cost", costStr);
if(startStr.length() != 8)
throw new HttpProcessingException(400, "Parameter 'start' must be exactly 8 digits long: YYYYMMDD");
@@ -938,6 +941,7 @@ public class AdminRequestHandler extends LotroServerRequestHandler implements Ur
var type = Tournament.TournamentType.parse(typeStr);
Throw400IfValidationFails("type", typeStr, type != null);
Throw400IfStringNull("name", name);
Throw400IfValidationFails("name", name, name.length() > 45, "Tournament name must be 45 characters or less.");
boolean wc = ParseBoolean("wc", wcStr, false);
Throw400IfStringNull("tournamentId", tournamentId);
Throw400IfStringNull("format", formatStr);