mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #13100, direct access to a tag page no longer excludes cid -1
This commit is contained in:
@@ -27,7 +27,7 @@ tagsController.getTag = async function (req, res) {
|
|||||||
breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[tags:tags]]', url: '/tags' }, { text: tag }]),
|
breadcrumbs: helpers.buildBreadcrumbs([{ text: '[[tags:tags]]', url: '/tags' }, { text: tag }]),
|
||||||
title: `[[pages:tag, ${tag}]]`,
|
title: `[[pages:tag, ${tag}]]`,
|
||||||
};
|
};
|
||||||
let [settings, cids, categoryData, canPost, isPrivileged, rssToken, isFollowing] = await Promise.all([
|
const [settings, cids, categoryData, canPost, isPrivileged, rssToken, isFollowing] = await Promise.all([
|
||||||
user.getSettings(req.uid),
|
user.getSettings(req.uid),
|
||||||
cid || categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'),
|
cid || categories.getCidsByPrivilege('categories:cid', req.uid, 'topics:read'),
|
||||||
helpers.getSelectedCategory(cid),
|
helpers.getSelectedCategory(cid),
|
||||||
@@ -37,13 +37,6 @@ tagsController.getTag = async function (req, res) {
|
|||||||
topics.isFollowingTag(req.params.tag, req.uid),
|
topics.isFollowingTag(req.params.tag, req.uid),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Explicitly exclude cid -1 if cid not specified
|
|
||||||
if (!cid) {
|
|
||||||
cids = new Set(cids);
|
|
||||||
cids.delete(-1);
|
|
||||||
cids = Array.from(cids);
|
|
||||||
}
|
|
||||||
|
|
||||||
const start = Math.max(0, (page - 1) * settings.topicsPerPage);
|
const start = Math.max(0, (page - 1) * settings.topicsPerPage);
|
||||||
const stop = start + settings.topicsPerPage - 1;
|
const stop = start + settings.topicsPerPage - 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user