Always specify Locale on toLowerCase and toUpperCase usages, fixes AuthMe not working correctly on machines with turkish locale. ('I'.toLowerCase() => 'ı')

This commit is contained in:
Gabriele C
2022-08-20 04:41:04 +02:00
parent c38e2aba28
commit 75b3a571e1
67 changed files with 217 additions and 143 deletions
@@ -11,6 +11,7 @@ import fr.xephi.authme.util.AtomicIntervalCounter;
import org.bukkit.scheduler.BukkitTask;
import javax.inject.Inject;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArrayList;
import static fr.xephi.authme.service.BukkitService.TICKS_PER_MINUTE;
@@ -176,7 +177,7 @@ public class AntiBotService implements SettingsDependent {
* @return true if the given name has been kicked because of Antibot
*/
public boolean wasPlayerKicked(String name) {
return antibotKicked.contains(name.toLowerCase());
return antibotKicked.contains(name.toLowerCase(Locale.ROOT));
}
/**
@@ -186,7 +187,7 @@ public class AntiBotService implements SettingsDependent {
* @param name the name to add
*/
public void addPlayerKick(String name) {
antibotKicked.addIfAbsent(name.toLowerCase());
antibotKicked.addIfAbsent(name.toLowerCase(Locale.ROOT));
}
public enum AntiBotStatus {