mirror of
				https://github.com/PlaceholderAPI/PlaceholderAPI
				synced 2025-10-30 18:03:43 +01:00 
			
		
		
		
	Force all identifiers to lower case
This commit is contained in:
		| @@ -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)); | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user