diff --git a/app/assets/javascripts/discourse/lib/user-search.js.es6 b/app/assets/javascripts/discourse/lib/user-search.js.es6 index a6349e2fa06..84edc4e4d62 100644 --- a/app/assets/javascripts/discourse/lib/user-search.js.es6 +++ b/app/assets/javascripts/discourse/lib/user-search.js.es6 @@ -1,5 +1,6 @@ import { CANCELLED_STATUS } from 'discourse/lib/autocomplete'; import { userPath } from 'discourse/lib/url'; +import { emailValid } from 'discourse/lib/utilities'; var cache = {}, cacheTopicId, @@ -61,7 +62,7 @@ function organizeResults(r, options) { }); } - if (!options.disallowEmails && options.term.match(/@/)) { + if (!options.disallowEmails && emailValid(options.term)) { let e = { username: options.term }; emails = [ e ]; results.push(e);