getTopicwithposts

v1.18.x
barisusakli 11 years ago
parent ef329c95df
commit 5160a4f90f

@ -1,6 +1,7 @@
"use strict"; "use strict";
var async = require('async'), var async = require('async'),
winston = require('winston'),
validator = require('validator'), validator = require('validator'),
_ = require('underscore'), _ = require('underscore'),
@ -243,6 +244,10 @@ var async = require('async'),
}; };
Topics.getTopicWithPosts = function(tid, set, uid, start, end, reverse, callback) { Topics.getTopicWithPosts = function(tid, set, uid, start, end, reverse, callback) {
if (end - start > 50) {
var e = new Error('TOO LARGE');
winston.warn('GET_TOPIC_WITH_POSTS set, start, end, uid, tid', set, start, end, uid, tid, e.stack);
}
Topics.getTopicData(tid, function(err, topicData) { Topics.getTopicData(tid, function(err, topicData) {
if (err || !topicData) { if (err || !topicData) {
return callback(err || new Error('[[error:no-topic]]')); return callback(err || new Error('[[error:no-topic]]'));

Loading…
Cancel
Save