mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
closes #680
This commit is contained in:
@@ -87,7 +87,12 @@ var winston = require('winston'),
|
|||||||
posts.getPostField(pid, 'tid', function(err, tid) {
|
posts.getPostField(pid, 'tid', function(err, tid) {
|
||||||
PostTools.isMain(pid, tid, function(err, isMainPost) {
|
PostTools.isMain(pid, tid, function(err, isMainPost) {
|
||||||
if (isMainPost) {
|
if (isMainPost) {
|
||||||
|
title = title.trim();
|
||||||
|
var slug = tid + '/' + utils.slugify(title);
|
||||||
|
|
||||||
topics.setTopicField(tid, 'title', title);
|
topics.setTopicField(tid, 'title', title);
|
||||||
|
topics.setTopicField(tid, 'slug', slug);
|
||||||
|
|
||||||
db.searchRemove('topic', tid, function() {
|
db.searchRemove('topic', tid, function() {
|
||||||
db.searchIndex('topic', title, tid);
|
db.searchIndex('topic', title, tid);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -623,10 +623,10 @@ websockets.init = function(io) {
|
|||||||
timeout: 2000
|
timeout: 2000
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (!data.title || data.title.length < topics.minimumTitleLength) {
|
} else if (!data.title || data.title.length < parseInt(meta.config.minimumTitleLength, 10)) {
|
||||||
topics.emitTitleTooShortAlert(socket);
|
topics.emitTitleTooShortAlert(socket);
|
||||||
return;
|
return;
|
||||||
} else if (!data.content || data.content.length < require('../public/config.json').minimumPostLength) {
|
} else if (!data.content || data.content.length < parseInt(meta.config.minimumPostLength, 10)) {
|
||||||
posts.emitContentTooShortAlert(socket);
|
posts.emitContentTooShortAlert(socket);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user