mirror of
https://github.com/discourse/discourse.git
synced 2025-06-09 02:18:05 +08:00
Improved email validation in user search module. (#5804)
This commit is contained in:

committed by
Régis Hanol

parent
738f3f5229
commit
71f74c0b28
@ -1,5 +1,6 @@
|
|||||||
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
|
import { CANCELLED_STATUS } from 'discourse/lib/autocomplete';
|
||||||
import { userPath } from 'discourse/lib/url';
|
import { userPath } from 'discourse/lib/url';
|
||||||
|
import { emailValid } from 'discourse/lib/utilities';
|
||||||
|
|
||||||
var cache = {},
|
var cache = {},
|
||||||
cacheTopicId,
|
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 };
|
let e = { username: options.term };
|
||||||
emails = [ e ];
|
emails = [ e ];
|
||||||
results.push(e);
|
results.push(e);
|
||||||
|
Reference in New Issue
Block a user