mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Force all identifiers to lower case
This commit is contained in:
parent
2e28647497
commit
0e733b6933
@ -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<String, @Nullable PlaceholderExpansion> 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);
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user