Require AFK timeout to be nonnegative

This commit is contained in:
calzoneman 2013-08-07 10:32:43 -04:00
parent 4af0291470
commit b12d639c78
1 changed files with 6 additions and 0 deletions

View File

@ -1680,6 +1680,12 @@ Channel.prototype.tryUpdateOptions = function(user, data) {
show_public: true
};
if ("afk_timeout" in data) {
data.afk_timeout = parseInt(data.afk_timeout);
if(data.afk_timeout < 0)
data.afk_timeout = 0;
}
for(var key in this.opts) {
if(key in data) {
if(key in adminonly && user.rank < Rank.Owner) {