mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-02 13:50:36 +01:00
closes #6067
This commit is contained in:
@@ -207,7 +207,6 @@ module.exports = function (Topics) {
|
||||
Topics.reply = function (data, callback) {
|
||||
var tid = data.tid;
|
||||
var uid = data.uid;
|
||||
var content = data.content;
|
||||
var postData;
|
||||
|
||||
async.waterfall([
|
||||
@@ -248,23 +247,15 @@ module.exports = function (Topics) {
|
||||
plugins.fireHook('filter:topic.reply', data, next);
|
||||
},
|
||||
function (filteredData, next) {
|
||||
content = filteredData.content || data.content;
|
||||
if (content) {
|
||||
content = utils.rtrim(content);
|
||||
if (data.content) {
|
||||
data.content = utils.rtrim(data.content);
|
||||
}
|
||||
|
||||
check(content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next);
|
||||
check(data.content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next);
|
||||
},
|
||||
function (next) {
|
||||
posts.create({
|
||||
uid: uid,
|
||||
tid: tid,
|
||||
handle: data.handle,
|
||||
content: content,
|
||||
toPid: data.toPid,
|
||||
timestamp: data.timestamp,
|
||||
ip: data.req ? data.req.ip : null,
|
||||
}, next);
|
||||
data.ip = data.req ? data.req.ip : null;
|
||||
posts.create(data, next);
|
||||
},
|
||||
function (_postData, next) {
|
||||
postData = _postData;
|
||||
|
||||
Reference in New Issue
Block a user