diff --git a/src/controllers/tags.js b/src/controllers/tags.js index 1b59483a4c..cb03e14589 100644 --- a/src/controllers/tags.js +++ b/src/controllers/tags.js @@ -13,7 +13,7 @@ tagsController.getTag = function(req, res, next) { return next(err); } - if (!tids || !tids.length) { + if (Array.isArray(tids) && !tids.length) { topics.deleteTag(tag); return res.render('tag', {topics: [], tag:tag}); } diff --git a/src/topics/tags.js b/src/topics/tags.js index c18289cf37..15fd437a26 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -47,7 +47,6 @@ module.exports = function(Topics) { return ''; } tag = tag.trim().toLowerCase(); - tag = tag.replace(/&/g, '&'); tag = tag.replace(/[,\/#!$%\^\*;:{}=_`<>'"~()?\|]/g, ''); tag = tag.substr(0, meta.config.maximumTagLength || 15); var matches = tag.match(/^[.-]*(.+?)[.-]*$/);