From b12d639c78f50c5e14f3fdd7e4dbf8ee7b797351 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 7 Aug 2013 10:32:43 -0400 Subject: [PATCH] Require AFK timeout to be nonnegative --- channel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channel.js b/channel.js index 62f6ffdf..0a3434ca 100644 --- a/channel.js +++ b/channel.js @@ -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) {