mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
filter dupe tags, closes #4216
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user