From f933fc0167ff69d09a917e990cb5559739fabf74 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 31 Dec 2013 14:27:56 -0500 Subject: [PATCH] forgot topics.js oops --- src/topics.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/topics.js b/src/topics.js index a96effea17..6b77b31d14 100644 --- a/src/topics.js +++ b/src/topics.js @@ -33,8 +33,10 @@ var async = require('async'), return callback(new Error('no-privileges')); } else if (!cid) { return callback(new Error('invalid-cid')); - } else if (!title || title.length < meta.config.minimumTitleLength) { + } else if (!title || title.length < parseInt(meta.config.minimumTitleLength, 10) { return callback(new Error('title-too-short'), null); + } else if(title.length > parseInt(meta.config.maximumTitleLength, 10)) { + return callback(new Error('title-too-long'), null); } else if (!content || content.length < meta.config.miminumPostLength) { return callback(new Error('content-too-short'), null); } @@ -897,16 +899,6 @@ var async = require('async'), }); } - Topics.emitTitleTooShortAlert = function(socket) { - socket.emit('event:alert', { - type: 'danger', - timeout: 2000, - title: 'Title too short', - message: "Please enter a longer title. At least " + meta.config.minimumTitleLength + " characters.", - alert_id: 'post_error' - }); - } - Topics.getTopicField = function(tid, field, callback) { db.getObjectField('topic:' + tid, field, callback); }