Merge pull request #4934 from AccaliaDeElementia/master

Allow first page of group members to be retrieved via websocket
v1.18.x
Barış Soner Uşaklı 9 years ago committed by GitHub
commit 474eea942f

@ -5,6 +5,7 @@ var async = require('async'),
groups = require('../groups'),
meta = require('../meta'),
user = require('../user'),
utils = require('../../public/src/utils'),
groupsController = require('../controllers/groups'),
SocketGroups = {};
@ -232,7 +233,7 @@ SocketGroups.searchMembers = function(socket, data, callback) {
};
SocketGroups.loadMoreMembers = function(socket, data, callback) {
if (!data.groupName || !parseInt(data.after, 10)) {
if (!data.groupName || !utils.isNumber(data.after) || parseInt(data.after, 10) < 0) {
return callback(new Error('[[error:invalid-data]]'));
}
data.after = parseInt(data.after, 10);

Loading…
Cancel
Save