Skip to content
Permalink
Browse files

Limiting nickname size

  • Loading branch information...
Depado committed Feb 12, 2015
1 parent b062ae9 commit 793413fafd4cfc99b77c5bd6973b389ca537c35f
Showing with 2 additions and 0 deletions.
  1. +2 −0 app.js
2 app.js
@@ -83,6 +83,8 @@ io.sockets.on('connection', function (socket) {
socket.emit('error', 'This nickname is already taken.');
} else if(username == 'null' || username == '' || username.indexOf(' ') >= 0) {
socket.emit('error', 'This is not a valid nickname.');
} else if(username.length > 25) {
socket.emit('error', 'This nickname is too damn long.');
} else {
var new_username = validator.escape(username);
if(socket.username in usernames) {

0 comments on commit 793413f

Please sign in to comment.
You can’t perform that action at this time.