From 8bef68001554a6c57ad277640556257779ca3e47 Mon Sep 17 00:00:00 2001 From: Marco Beyer Date: Thu, 21 Aug 2025 16:44:28 +0200 Subject: [PATCH 1/2] (fix) Return relative asset URL instead of absolute asset url (#13605) * Return relative asset URL instead of absolute asset url * fixed linter issues and repeating relative path --- src/controllers/category.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/category.js b/src/controllers/category.js index fe3809b825..52030a9465 100644 --- a/src/controllers/category.js +++ b/src/controllers/category.js @@ -222,12 +222,14 @@ function addTags(categoryData, res, currentPage) { ]; if (categoryData.backgroundImage) { - if (!categoryData.backgroundImage.startsWith('http')) { - categoryData.backgroundImage = url + categoryData.backgroundImage; + let {backgroundImage} = categoryData; + backgroundImage = utils.decodeHTMLEntities(backgroundImage); + if (!backgroundImage.startsWith('http')) { + backgroundImage = url + backgroundImage.replace(new RegExp(`^${nconf.get('relative_path')}`), ''); } res.locals.metaTags.push({ property: 'og:image', - content: categoryData.backgroundImage, + content: backgroundImage, noEscape: true, }); } From 181aa9c2edf0b1494cf2a6d85c839abbedd11e09 Mon Sep 17 00:00:00 2001 From: Marco Beyer Date: Thu, 21 Aug 2025 16:45:06 +0200 Subject: [PATCH 2/2] (fix) fixed typos in activitypub urls (#13610) --- src/controllers/category.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/category.js b/src/controllers/category.js index 52030a9465..d03a14c9e1 100644 --- a/src/controllers/category.js +++ b/src/controllers/category.js @@ -172,7 +172,7 @@ categoryController.get = async function (req, res, next) { if (meta.config.activitypubEnabled) { // Include link header for richer parsing - res.set('Link', `<${nconf.get('url')}/actegory/${cid}>; rel="alternate"; type="application/activity+json"`); + res.set('Link', `<${nconf.get('url')}/category/${cid}>; rel="alternate"; type="application/activity+json"`); // Category accessible const remoteOk = await privileges.categories.can('read', cid, activitypub._constants.uid); @@ -259,7 +259,7 @@ function addTags(categoryData, res, currentPage) { res.locals.linkTags.push({ rel: 'alternate', type: 'application/activity+json', - href: `${nconf.get('url')}/actegory/${categoryData.cid}`, + href: `${nconf.get('url')}/category/${categoryData.cid}`, }); } }