Don't allow user names to be set if the length exceeds 16 characters

This commit is contained in:
Luck 2017-11-22 17:17:49 +00:00
parent 211fb219a7
commit 26feeb125e
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -117,6 +117,9 @@ public class User extends PermissionHolder implements Identifiable<UserIdentifie
* @return true if a change was made * @return true if a change was made
*/ */
public boolean setName(String name, boolean weak) { public boolean setName(String name, boolean weak) {
if (name != null && name.length() > 16) {
return false; // nope
}
// if weak is true, only update the value in the User if it's null // if weak is true, only update the value in the User if it's null
if (weak && this.name != null) { if (weak && this.name != null) {