Skip to content

Commit

Permalink
#3546: Add string length checks to isValidName
Browse files Browse the repository at this point in the history
  • Loading branch information
Outfluencer authored Oct 28, 2023
1 parent f903c54 commit e442c3d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ private static boolean isNameAllowedCharacter(char c, 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++ )
{
if ( !isNameAllowedCharacter( name.charAt( index ), onlineMode ) )
Expand Down

0 comments on commit e442c3d

Please sign in to comment.