mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
Zscan (#8458)
* feat: zscan * fix: mongodb tests * feat: scan, ip search starts with
This commit is contained in:
committed by
GitHub
parent
be85123ad5
commit
e95cd28f6f
@@ -472,20 +472,7 @@ module.exports = function (module) {
|
||||
project.score = 1;
|
||||
}
|
||||
|
||||
let match = params.match;
|
||||
if (params.match.startsWith('*')) {
|
||||
match = match.substring(1);
|
||||
}
|
||||
if (params.match.endsWith('*')) {
|
||||
match = match.substring(0, match.length - 1);
|
||||
}
|
||||
match = utils.escapeRegexChars(match);
|
||||
if (!params.match.startsWith('*')) {
|
||||
match = '^' + match;
|
||||
}
|
||||
if (!params.match.endsWith('*')) {
|
||||
match += '$';
|
||||
}
|
||||
const match = helpers.buildMatchQuery(params.match);
|
||||
let regex;
|
||||
try {
|
||||
regex = new RegExp(match);
|
||||
|
||||
Reference in New Issue
Block a user