mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-21 20:02:03 +01:00
fixed #5782
This commit is contained in:
@@ -15,7 +15,7 @@ module.exports = function (SocketPosts) {
|
||||
SocketPosts.edit = function (socket, data, callback) {
|
||||
if (!socket.uid) {
|
||||
return callback(new Error('[[error:not-logged-in]]'));
|
||||
} else if (!data || !data.pid || !data.content) {
|
||||
} else if (!data || !data.pid || (parseInt(meta.config.minimumPostLength, 10) !== 0 && !data.content)) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = function (SocketPosts) {
|
||||
return callback(new Error('[[error:not-enough-tags, ' + meta.config.minimumTagsPerTopic + ']]'));
|
||||
} else if (data.tags && data.tags.length > parseInt(meta.config.maximumTagsPerTopic, 10)) {
|
||||
return callback(new Error('[[error:too-many-tags, ' + meta.config.maximumTagsPerTopic + ']]'));
|
||||
} else if (contentLen < parseInt(meta.config.minimumPostLength, 10)) {
|
||||
} else if (parseInt(meta.config.minimumPostLength, 10) !== 0 && contentLen < parseInt(meta.config.minimumPostLength, 10)) {
|
||||
return callback(new Error('[[error:content-too-short, ' + meta.config.minimumPostLength + ']]'));
|
||||
} else if (contentLen > parseInt(meta.config.maximumPostLength, 10)) {
|
||||
return callback(new Error('[[error:content-too-long, ' + meta.config.maximumPostLength + ']]'));
|
||||
|
||||
Reference in New Issue
Block a user