From f0f038b57a92a0df53a8b79f0f34ca10602fc4cb Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 22 Jun 2017 09:35:33 +0200 Subject: [PATCH] Quote string replacements to avoid pattern issues --- .../brigadier/exceptions/ParameterizedCommandExceptionType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java b/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java index 110c29b..7741919 100644 --- a/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java +++ b/src/main/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionType.java @@ -30,7 +30,7 @@ public class ParameterizedCommandExceptionType implements CommandExceptionType { final Matcher matcher = PATTERN.matcher(message); final StringBuffer result = new StringBuffer(); while (matcher.find()) { - matcher.appendReplacement(result, exception.getData().get(matcher.group(1)).toString()); + matcher.appendReplacement(result, Matcher.quoteReplacement(exception.getData().get(matcher.group(1)).toString())); } matcher.appendTail(result); return result.toString();