Skip to content

Node.js based forum software built for the modern web

fix: getSortedTopics; filter out topics in cid -1 unless explicitly asked for

Julian Lamdff5d1c6cd1a
diff --git a/src/topics/sorted.js b/src/topics/sorted.js
index 92cc2f6ed6..77a31b3422 100644
--- a/src/topics/sorted.js
+++ b/src/topics/sorted.js
@@ -257,6 +257,7 @@ module.exports = function (Topics) {
t &&
t.cid &&
!isCidIgnored[t.cid] &&
+ (cids || parseInt(t.cid, 10) !== -1) &&
(!cids || cids.includes(String(t.cid))) &&
(!tags.length || tags.every(tag => t.tags.find(topicTag => topicTag.value === tag)))
)).map(t => t.tid);