mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-16 11:37:37 +01:00
trim tag after substr
this prevents spaces in the middle of the tag from being added to the db
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user