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

@ -244,10 +244,7 @@ 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]]'));
@ -268,7 +265,10 @@ var async = require('async'),
if (err) { if (err) {
return next(err); return next(err);
} }
if (posts.length > 100) {
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.addPostData(posts, uid, next); Topics.addPostData(posts, uid, next);
}); });
}); });
@ -337,7 +337,7 @@ var async = require('async'),
Topics.addPostData(postData, uid, callback); Topics.addPostData(postData, uid, callback);
}); });
}); });
} };
Topics.getTeasers = function(tids, uid, callback) { Topics.getTeasers = function(tids, uid, callback) {
if(!Array.isArray(tids)) { if(!Array.isArray(tids)) {

Loading…
Cancel
Save