Fixed checking username availability

pull/2168/head
Marcelo Schmidt 9 years ago
parent 17c4c44c43
commit 1a15523fd2
  1. 2
      packages/rocketchat-lib/server/functions/checkUsernameAvailability.coffee

@ -1,2 +1,2 @@
RocketChat.checkUsernameAvailability = (username) ->
return not Meteor.users.findOne({ username: { $regex : new RegExp("^" + s.trim(username) + "$", "i") } })
return not Meteor.users.findOne({ username: { $regex : new RegExp("^" + s.trim(s.escapeRegExp(username)) + "$", "i") } })

Loading…
Cancel
Save