From df0a5e780ae22fda7acf64d25764380f39bad1e0 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 7 Aug 2014 20:03:56 -0400 Subject: [PATCH] prevent edit to change title length above max --- src/socket.io/posts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 9364124ff2..328eda21f2 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -161,6 +161,8 @@ SocketPosts.edit = function(socket, data, callback) { return callback(new Error('[[error:invalid-data]]')); } else if (!data.title || data.title.length < parseInt(meta.config.minimumTitleLength, 10)) { return callback(new Error('[[error:title-too-short, ' + meta.config.minimumTitleLength + ']]')); + } else if (data.title.length > parseInt(meta.config.maximumTitleLength, 10)) { + return callback(new Error('[[error:title-too-long, ' + meta.config.maximumTitleLength + ']]')); } else if (!data.content || data.content.length < parseInt(meta.config.minimumPostLength, 10)) { return callback(new Error('[[error:content-too-short, ' + meta.config.minimumPostLength + ']]')); }