diff --git a/modules/users/api.js b/modules/users/api.js index 471fab6..e59c895 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -14,13 +14,13 @@ var api = function(dbot) { // this is retarded user = user.toLowerCase(); var resolvedUser = _.find(knownUsers.users, function(nick) { - var toMatch = new RegExp(user, "i"); + var toMatch = new RegExp(_.escape(user), "i"); return nick.match(toMatch) !== null; }, this); if(!resolvedUser) { resolvedUser = _.find(knownUsers.aliases, function(nick, alias) { - var toMatch = new RegExp(user, "i"); + var toMatch = new RegExp(_.escape(user), "i"); return alias.match(toMatch) !== null; }, this); user = knownUsers.aliases[resolvedUser];