From 962d14746ee9c84da3841bfb82b495928a6ae4d8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 13 Nov 2014 15:02:20 -0500 Subject: [PATCH] trim tag after substr this prevents spaces in the middle of the tag from being added to the db --- src/topics/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 7723fb6640..0999584498 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -49,7 +49,7 @@ module.exports = function(Topics) { } tag = tag.trim().toLowerCase(); tag = tag.replace(/[,\/#!$%\^\*;:{}=_`<>'"~()?\|]/g, ''); - tag = tag.substr(0, meta.config.maximumTagLength || 15); + tag = tag.substr(0, meta.config.maximumTagLength || 15).trim(); var matches = tag.match(/^[.-]*(.+?)[.-]*$/); if (matches && matches.length > 1) { tag = matches[1];