mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-09 12:36:41 -05:00
Ban non-alnum characters at start of names
This commit is contained in:
parent
762fdcc4fd
commit
f7ea60fe25
3
users.js
3
users.js
|
|
@ -571,13 +571,12 @@ var User = (function () {
|
|||
Rooms.get(i, 'lobby').onUpdateIdentity(this);
|
||||
}
|
||||
};
|
||||
var bannedNameStartChars = {'~':1, '&':1, '@':1, '%':1, '+':1, '-':1, '!':1, '?':1, '#':1, ' ':1, '{':1, '}':1};
|
||||
User.prototype.filterName = function (name) {
|
||||
if (Config.namefilter) {
|
||||
name = Config.namefilter(name);
|
||||
}
|
||||
name = toName(name);
|
||||
while (bannedNameStartChars[name.charAt(0)]) {
|
||||
while (!/[A-Za-z0-9]/.test(name.charAt(0))) {
|
||||
name = name.substr(1);
|
||||
}
|
||||
return name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user