From 0e733b69335206486b5ed9ad3372385e0518d7ac Mon Sep 17 00:00:00 2001 From: extendedclip Date: Fri, 31 Jul 2020 12:01:27 -0400 Subject: [PATCH] Force all identifiers to lower case --- .../java/me/clip/placeholderapi/replacer/CharsReplacer.java | 4 ++-- .../me/clip/placeholderapi/replacer/ReplacerUnitTester.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java index f40deec..13a5ca2 100644 --- a/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java +++ b/src/main/java/me/clip/placeholderapi/replacer/CharsReplacer.java @@ -44,7 +44,7 @@ public final class CharsReplacer implements Replacer @Override public String apply(@NotNull final String text, @Nullable final OfflinePlayer player, @NotNull final Function lookup) { - final char[] chars = text.toLowerCase().toCharArray(); + final char[] chars = text.toCharArray(); final StringBuilder builder = new StringBuilder(text.length()); final StringBuilder identifier = new StringBuilder(); @@ -144,7 +144,7 @@ public final class CharsReplacer implements Replacer } } - final String identifierString = identifier.toString(); + final String identifierString = identifier.toString().toLowerCase(); final String parametersString = parameters.toString(); identifier.setLength(0); diff --git a/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java b/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java index 71fae9b..6dffa48 100644 --- a/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java +++ b/src/test/java/me/clip/placeholderapi/replacer/ReplacerUnitTester.java @@ -87,7 +87,7 @@ public final class ReplacerUnitTester @Test void testCharsReplacerHandlesEscapedHex() { - final String text = "\\&xFFFFFFThis should not change."; + final String text = "\\&xffffffThis should not change."; assertEquals(text.substring(1), Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get)); }