mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 11:44:00 +08:00
Improved email validation in user search module. (#5804)
This commit is contained in:
parent
738f3f5229
commit
71f74c0b28
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user