#3546: Add string length checks to isValidName
This commit is contained in:
parent
f903c54d55
commit
e442c3da5c
@ -27,6 +27,11 @@ public final class AllowedCharacters
|
|||||||
|
|
||||||
public static boolean isValidName(String name, boolean onlineMode)
|
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++ )
|
for ( int index = 0, len = name.length(); index < len; index++ )
|
||||||
{
|
{
|
||||||
if ( !isNameAllowedCharacter( name.charAt( index ), onlineMode ) )
|
if ( !isNameAllowedCharacter( name.charAt( index ), onlineMode ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user