From c2ba55ac0f09d0ea0c41d9e3a6182616abbf203f Mon Sep 17 00:00:00 2001 From: calzoneman Date: Mon, 18 Aug 2014 22:00:51 -0500 Subject: [PATCH] Fail /kick, /ban if the target name is blank --- lib/channel/kickban.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/channel/kickban.js b/lib/channel/kickban.js index 33c88f90..233e02f3 100644 --- a/lib/channel/kickban.js +++ b/lib/channel/kickban.js @@ -154,7 +154,7 @@ KickBanModule.prototype.handleCmdKick = function (user, msg, meta) { var args = msg.split(" "); args.shift(); /* shift off /kick */ - if (args.length === 0) { + if (args.length === 0 || args[0].trim() === "") { return user.socket.emit("errorMsg", { msg: "No kick target specified. If you're trying to kick " + "anonymous users, use /kickanons" @@ -213,7 +213,7 @@ KickBanModule.prototype.handleCmdKickAnons = function (user, msg, meta) { KickBanModule.prototype.handleCmdBan = function (user, msg, meta) { var args = msg.split(" "); args.shift(); /* shift off /ban */ - if (args.length === 0) { + if (args.length === 0 || args[0].trim() === "") { return user.socket.emit("errorMsg", { msg: "No ban target specified." }); @@ -232,7 +232,7 @@ KickBanModule.prototype.handleCmdBan = function (user, msg, meta) { KickBanModule.prototype.handleCmdIPBan = function (user, msg, meta) { var args = msg.split(" "); args.shift(); /* shift off /ipban */ - if (args.length === 0) { + if (args.length === 0 || args[0].trim() === "") { return user.socket.emit("errorMsg", { msg: "No ban target specified." });