mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: tweak user.search to better handle local usernames with colons in them
This commit is contained in:
@@ -94,9 +94,11 @@ module.exports = function (User) {
|
|||||||
const data = await db.getSortedSetRangeByLex(`${searchBy}:sorted`, min, max, 0, hardCap);
|
const data = await db.getSortedSetRangeByLex(`${searchBy}:sorted`, min, max, 0, hardCap);
|
||||||
// const uids = data.map(data => data.split(':').pop());
|
// const uids = data.map(data => data.split(':').pop());
|
||||||
const uids = data.map((data) => {
|
const uids = data.map((data) => {
|
||||||
data = data.split(':');
|
if (data.includes(':https:')) {
|
||||||
data.shift();
|
return data.substring(data.indexOf(':https:') + 1);
|
||||||
return data.join(':');
|
}
|
||||||
|
|
||||||
|
return data.split(':').pop();
|
||||||
});
|
});
|
||||||
return uids;
|
return uids;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user