From e39fda2b453bd40aa60c829f884d26b8ce3a25e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 19 Feb 2016 21:58:21 +0200 Subject: [PATCH] filter dupe tags, closes #4216 --- src/topics/tags.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 527913557a..1b47a5d0e6 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -24,8 +24,8 @@ module.exports = function(Topics) { }, function (data, next) { tags = data.tags.slice(0, meta.config.maximumTagsPerTopic || 5); - tags = tags.map(Topics.cleanUpTag).filter(function(tag) { - return tag && tag.length >= (meta.config.minimumTagLength || 3); + tags = tags.map(Topics.cleanUpTag).filter(function(tag, index, array) { + return tag && tag.length >= (meta.config.minimumTagLength || 3) && array.indexOf(tag) === index; }); var keys = tags.map(function(tag) {