#3546: Add string length checks to isValidName

This commit is contained in:
Outfluencer
2023-10-28 04:11:55 +02:00
committed by GitHub
parent f903c54d55
commit e442c3da5c

View File

@@ -27,6 +27,11 @@ public final class AllowedCharacters
public static boolean isValidName(String name, boolean onlineMode)
{
if ( name.isEmpty() || name.length() > 16 )
{
return false;
}
for ( int index = 0, len = name.length(); index < len; index++ )
{
if ( !isNameAllowedCharacter( name.charAt( index ), onlineMode ) )