From 2cb0af0ca4fa0fea38283612fcf4df9fb9f8b4db Mon Sep 17 00:00:00 2001 From: pop4959 Date: Mon, 11 Mar 2024 01:14:58 -0700 Subject: [PATCH] Strict parsing for legacy converted placeholders (#5740) This fixes issues where arguments converted implicitly from MiniMessage are prone to bleeding into the rest of the output. The fix mostly works since `MINI_MESSAGE_NO_TAGS` is only used for legacy conversion, while `miniMessageInstance` is used in all other cases normally. If that were not the case, we would not want strict parsing everywhere since we don't enforce this in translations anyway. Fixes #5729 Fixes #5730 Fixes #5732 Fixes #5735 Fixes #5720 Closes #5728 --- .../main/java/com/earth2me/essentials/utils/AdventureUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/utils/AdventureUtil.java b/Essentials/src/main/java/com/earth2me/essentials/utils/AdventureUtil.java index e3d361803..e32d4d218 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/utils/AdventureUtil.java +++ b/Essentials/src/main/java/com/earth2me/essentials/utils/AdventureUtil.java @@ -50,7 +50,7 @@ public final class AdventureUtil { } LEGACY_SERIALIZER = builder.build(); - MINI_MESSAGE_NO_TAGS = MiniMessage.miniMessage(); + MINI_MESSAGE_NO_TAGS = MiniMessage.builder().strict(true).build(); miniMessageInstance = createMiniMessageInstance(); }