From 5084b3e45374a4b392cd8b69e4834040ce99dcad Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 16 Aug 2023 14:41:45 -0400 Subject: [PATCH] Petitions limited to 255 characters. --- src/engine/db/handlers/dbPetitionHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/db/handlers/dbPetitionHandler.java b/src/engine/db/handlers/dbPetitionHandler.java index 3af4fd53..23237c01 100644 --- a/src/engine/db/handlers/dbPetitionHandler.java +++ b/src/engine/db/handlers/dbPetitionHandler.java @@ -65,7 +65,9 @@ public class dbPetitionHandler extends dbHandlerBase { preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID()); preparedStatement.setString(7, petition.reportPlayer.getFirstName()); preparedStatement.setString(8, petition.playerLocation.toString()); - preparedStatement.setString(9, petition.message); + + String messageCleaned = petition.message.substring(0, Math.min(petition.message.length(), 255)); + preparedStatement.setString(9, messageCleaned); preparedStatement.executeUpdate();