FIX: Do not skip some emails in user search (#8317)
It used to skip the email addresses containing the plus sign.
This commit is contained in:
parent
6672dcc985
commit
55bdd9e6a2
|
@ -136,7 +136,7 @@ function organizeResults(r, options) {
|
|||
// will not find me, which is a reasonable compromise
|
||||
//
|
||||
// we also ignore if we notice a double space or a string that is only a space
|
||||
const ignoreRegex = /([\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\/:;<=>?\[\]^`{|}~])|\s\s|^\s$/;
|
||||
const ignoreRegex = /([\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*,\/:;<=>?\[\]^`{|}~])|\s\s|^\s$|^[^+]*\+[^@]*$/;
|
||||
|
||||
function skipSearch(term, allowEmails) {
|
||||
if (term.indexOf("@") > -1 && !allowEmails) {
|
||||
|
|
|
@ -169,6 +169,9 @@ QUnit.test("it skips a search depending on punctuations", async assert => {
|
|||
// 6 + email
|
||||
assert.equal(results.length, 7);
|
||||
|
||||
results = await userSearch({ term: "sam+test@sam.com", allowEmails: true });
|
||||
assert.equal(results.length, 7);
|
||||
|
||||
results = await userSearch({ term: "sam@sam.com" });
|
||||
assert.equal(results.length, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue