Skip to content

Node.js based forum software built for the modern web

fix: fix pid double-escape in /world, improper helper call in feed/item.tpl

Julian Lam1a04fc590b4d
diff --git a/src/controllers/activitypub/topics.js b/src/controllers/activitypub/topics.js
index 0b44b5cc15..f5be0926bb 100644
--- a/src/controllers/activitypub/topics.js
+++ b/src/controllers/activitypub/topics.js
@@ -115,7 +115,6 @@ controller.list = async function (req, res) {
]);
postData.forEach((p, index) => {
- p.pid = encodeURIComponent(p.pid);
if (p.topic) {
p.topic = { ...p.topic };
p.topic.thumbs = topicData[index].thumbs;
diff --git a/src/views/partials/feed/item.tpl b/src/views/partials/feed/item.tpl
index 95b62cf971..f73ad8a67b 100644
--- a/src/views/partials/feed/item.tpl
+++ b/src/views/partials/feed/item.tpl
@@ -61,7 +61,7 @@
<button component="show/more" class="btn btn-link btn-sm fw-semibold hidden ff-secondary text-secondary ms-auto me-auto">[[world:see-more]]</button>
<hr class="my-2"/>
<div class="d-flex justify-content-between">
- <a href="{config.relative_path}/post/{{{ if ./topic.teaserPid }}}{encodeURIComponent(./topic.teaserPid)}{{{ else }}}{encodeURIComponent(./pid)){{{ end }}}" class="btn btn-link btn-sm text-body {{{ if !./isMainPost }}}invisible{{{ end }}}"><i class="fa-fw fa-regular fa-message text-muted"></i> {humanReadableNumber(./topic.postcount)}</a>
+ <a href="{config.relative_path}/post/{{{ if ./topic.teaserPid }}}{encodeURIComponent(./topic.teaserPid)}{{{ else }}}{encodeURIComponent(./pid)}{{{ end }}}" class="btn btn-link btn-sm text-body {{{ if !./isMainPost }}}invisible{{{ end }}}"><i class="fa-fw fa-regular fa-message text-muted"></i> {humanReadableNumber(./topic.postcount)}</a>
<a href="#" data-pid="{./pid}" data-action="bookmark" data-bookmarked="{./bookmarked}" data-bookmarks="{./bookmarks}" class="btn btn-link btn-sm text-body"><i class="fa-fw fa-bookmark {{{ if ./bookmarked }}}fa text-primary{{{ else }}}fa-regular text-muted{{{ end }}}"></i> <span component="bookmark-count">{humanReadableNumber(./bookmarks)}</span></a>