SPIGOT-7676: Enforce locale parameter in toLowerCase and toUpperCase method calls and always use root locale

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
Bukkit/Spigot
2024-06-03 07:18:14 +10:00
parent b0df4fc813
commit a3fb15bc23
23 changed files with 76 additions and 45 deletions

View File

@ -5,6 +5,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Locale;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -86,7 +87,7 @@ public @interface Warning {
if (value == null) {
return DEFAULT;
}
WarningState state = values.get(value.toLowerCase());
WarningState state = values.get(value.toLowerCase(Locale.ROOT));
if (state == null) {
return DEFAULT;
}