Skip to content

Node.js based forum software built for the modern web

enhancing:tm: post reply length checker to account for line breaks in redactor

Julian Lam8226fd6566d0
diff --git a/src/topics/create.js b/src/topics/create.js
index 815d703d01..da16489f05 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -329,7 +329,7 @@ module.exports = function (Topics) {
function check(item, min, max, minError, maxError, callback) {
// Trim and remove HTML (latter for composers that send in HTML, like redactor)
if (typeof item === 'string') {
- item = S(item.trim()).stripTags().s;
+ item = S(item).stripTags().s.trim();
}
if (!item || item.length < parseInt(min, 10)) {