|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
|
var validator = require('validator');
|
|
|
|
|
var S = require('string');
|
|
|
|
|
var db = require('../database');
|
|
|
|
|
var utils = require('../../public/src/utils');
|
|
|
|
|
var plugins = require('../plugins');
|
|
|
|
@ -327,6 +328,9 @@ 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)
|
|
|
|
|
item = S(item.trim()).stripTags().s;
|
|
|
|
|
|
|
|
|
|
if (!item || item.length < parseInt(min, 10)) {
|
|
|
|
|
return callback(new Error('[[error:' + minError + ', ' + min + ']]'));
|
|
|
|
|
} else if (item.length > parseInt(max, 10)) {
|
|
|
|
|