fix: don't prepend relative_path to absolute URLs in getProfilePictures (#14176)

Upload plugins like nodebb-plugin-cloudinary store full absolute URLs
in the uid:{uid}:profile:pictures sorted set. The code unconditionally
prepends relative_path, producing broken URLs like /forumhttps://...

Add the same startsWith('http') check used elsewhere in the codebase.
This commit is contained in:
Dirk Plate
2026-04-15 14:59:36 +02:00
committed by GitHub
parent c40708f4ca
commit 37f2319091

View File

@@ -39,7 +39,7 @@ module.exports = function (SocketUser) {
userPictures.forEach((picture) => {
list.pictures.push({
type: 'uploaded',
url: `${nconf.get('relative_path')}${picture}`,
url: picture.startsWith('http') ? picture : `${nconf.get('relative_path')}${picture}`,
text: '[[user:uploaded-picture]]',
});
});