|
|
@ -105,10 +105,6 @@ module.exports = function (Topics) {
|
|
|
|
data.content = utils.rtrim(data.content);
|
|
|
|
data.content = utils.rtrim(data.content);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (parseInt(meta.config.minimumPostLength, 10) === 0) {
|
|
|
|
|
|
|
|
// Abort if minimum post length is set to 0
|
|
|
|
|
|
|
|
return setImmediate(next);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
check(data.content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next);
|
|
|
|
check(data.content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function (next) {
|
|
|
|
function (next) {
|
|
|
@ -350,7 +346,7 @@ module.exports = function (Topics) {
|
|
|
|
item = S(item).stripTags().s.trim();
|
|
|
|
item = S(item).stripTags().s.trim();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!item || item.length < parseInt(min, 10)) {
|
|
|
|
if (item === null || item === undefined || item.length < parseInt(min, 10)) {
|
|
|
|
return callback(new Error('[[error:' + minError + ', ' + min + ']]'));
|
|
|
|
return callback(new Error('[[error:' + minError + ', ' + min + ']]'));
|
|
|
|
} else if (item.length > parseInt(max, 10)) {
|
|
|
|
} else if (item.length > parseInt(max, 10)) {
|
|
|
|
return callback(new Error('[[error:' + maxError + ', ' + max + ']]'));
|
|
|
|
return callback(new Error('[[error:' + maxError + ', ' + max + ']]'));
|
|
|
|