Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Commit

Permalink
Filter out invalid usernames in tellWho
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Sep 24, 2012
1 parent ce4124d commit a591a18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions brains.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ function stopWatching (m, who, what, where, words) {
commands.tell = function (m, who, what, where, words) {
var tellWho = words[1]
, msg
if (tellWho.match(/[<>]/) || !tellWho)
return respond.call(this, who, where, "That's not a valid username.")
leaveNote.call(this, tellWho, who, what, where)
msg = "I'll be sure to tell "+tellWho
respond.call(this, who, where, msg)
Expand Down

0 comments on commit a591a18

Please sign in to comment.