v1.18.x
barisusakli 11 years ago
parent 1e6eaffd43
commit 95979d9d97

@ -13,7 +13,7 @@ tagsController.getTag = function(req, res, next) {
return next(err); return next(err);
} }
if (!tids || !tids.length) { if (Array.isArray(tids) && !tids.length) {
topics.deleteTag(tag); topics.deleteTag(tag);
return res.render('tag', {topics: [], tag:tag}); return res.render('tag', {topics: [], tag:tag});
} }

@ -47,7 +47,6 @@ module.exports = function(Topics) {
return ''; return '';
} }
tag = tag.trim().toLowerCase(); tag = tag.trim().toLowerCase();
tag = tag.replace(/&/g, '&');
tag = tag.replace(/[,\/#!$%\^\*;:{}=_`<>'"~()?\|]/g, ''); tag = tag.replace(/[,\/#!$%\^\*;:{}=_`<>'"~()?\|]/g, '');
tag = tag.substr(0, meta.config.maximumTagLength || 15); tag = tag.substr(0, meta.config.maximumTagLength || 15);
var matches = tag.match(/^[.-]*(.+?)[.-]*$/); var matches = tag.match(/^[.-]*(.+?)[.-]*$/);

Loading…
Cancel
Save