changed order of cleanup

v1.18.x
barisusakli 11 years ago
parent b7fcde446b
commit e505a9a6ac

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

Loading…
Cancel
Save