diff --git a/package.json b/package.json index 2824452b..a54bd028 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.58.2", + "version": "3.58.3", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/src/channel/channel.js b/src/channel/channel.js index 34d20554..c1d9c68d 100644 --- a/src/channel/channel.js +++ b/src/channel/channel.js @@ -338,7 +338,7 @@ Channel.prototype.checkModules = function (fn, args, cb) { }; args.push(next); - next(null, ChannelModule.PASSTHROUGH); + process.nextTick(next, null, ChannelModule.PASSTHROUGH); }); }; diff --git a/src/channel/kickban.js b/src/channel/kickban.js index c080fa2b..9c342bf3 100644 --- a/src/channel/kickban.js +++ b/src/channel/kickban.js @@ -232,7 +232,7 @@ KickBanModule.prototype.handleCmdBan = function (user, msg, _meta) { this.banName(user, name, reason).catch(error => { const message = error.message || error; user.socket.emit("errorMsg", { msg: message }); - }).finally(() => { + }).then(() => { chan.refCounter.unref("KickBanModule::handleCmdBan"); }); }; @@ -264,7 +264,7 @@ KickBanModule.prototype.handleCmdIPBan = function (user, msg, _meta) { //console.log('!!!', error.stack); const message = error.message || error; user.socket.emit("errorMsg", { msg: message }); - }).finally(() => { + }).then(() => { chan.refCounter.unref("KickBanModule::handleCmdIPBan"); }); }; diff --git a/src/database/accounts.js b/src/database/accounts.js index 7201348b..d9370d6b 100644 --- a/src/database/accounts.js +++ b/src/database/accounts.js @@ -228,6 +228,11 @@ module.exports = { return; } + if (!$util.isValidUserName(name)) { + callback(`Invalid username "${name}"`); + return; + } + /* Passwords are capped at 100 characters to prevent a potential denial of service vector through causing the server to hash ridiculously long strings.