mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 14:06:47 +02:00
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:
@@ -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]]',
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user