mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: handle remote userslugs with non-lowercase letters
This commit is contained in:
@@ -180,7 +180,7 @@ async function getPostsFromUserSet(template, req, res) {
|
|||||||
// exposeUid returns -2 for all remote users for ease of processing, restoring uid
|
// exposeUid returns -2 for all remote users for ease of processing, restoring uid
|
||||||
let { uid } = res.locals;
|
let { uid } = res.locals;
|
||||||
if (uid === -2) {
|
if (uid === -2) {
|
||||||
uid = await db.getObjectField('handle:uid', req.params.userslug);
|
uid = await db.getObjectField('handle:uid', req.params.userslug.toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
const [{ username, userslug }, settings] = await Promise.all([
|
const [{ username, userslug }, settings] = await Promise.all([
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ User.getUidByUserslug = async function (userslug) {
|
|||||||
|
|
||||||
if (userslug.includes('@')) {
|
if (userslug.includes('@')) {
|
||||||
await activitypub.actors.assert(userslug);
|
await activitypub.actors.assert(userslug);
|
||||||
return (await db.getObjectField('handle:uid', userslug)) || null;
|
return (await db.getObjectField('handle:uid', String(userslug).toLowerCase())) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return await db.sortedSetScore('userslug:uid', userslug);
|
return await db.sortedSetScore('userslug:uid', userslug);
|
||||||
|
|||||||
Reference in New Issue
Block a user