mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +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 uids = data.map(data => data.split(':').pop());
|
||||
const uids = data.map((data) => {
|
||||
data = data.split(':');
|
||||
data.shift();
|
||||
return data.join(':');
|
||||
if (data.includes(':https:')) {
|
||||
return data.substring(data.indexOf(':https:') + 1);
|
||||
}
|
||||
|
||||
return data.split(':').pop();
|
||||
});
|
||||
return uids;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user