diff --git a/public/src/client/account/header.js b/public/src/client/account/header.js index d29b58c05b..1b16aec4b1 100644 --- a/public/src/client/account/header.js +++ b/public/src/client/account/header.js @@ -120,7 +120,7 @@ define('forum/account/header', [ data[cur.name] = cur.value; return data; }, {}); - var until = formData.length ? (Date.now() + formData.length * 1000 * 60 * 60 * (parseInt(formData.unit, 10) ? 24 : 1)) : 0; + var until = parseInt(formData.length, 10) ? (Date.now() + formData.length * 1000 * 60 * 60 * (parseInt(formData.unit, 10) ? 24 : 1)) : 0; socket.emit('user.banUsers', { uids: [ajaxify.data.theirid], until: until, reason: formData.reason || '' }, function (err) { if (err) { diff --git a/src/user/info.js b/src/user/info.js index 46b4024e32..1ed9cdef14 100644 --- a/src/user/info.js +++ b/src/user/info.js @@ -123,7 +123,7 @@ module.exports = function (User) { banObj.timestamp = parseInt(banObj.score, 10); banObj.timestampReadable = new Date(banObj.score).toString(); banObj.timestampISO = new Date(banObj.score).toISOString(); - banObj.reason = validator.escape(String(reasons[banObj.score])) || '[[user:info.banned-no-reason]]'; + banObj.reason = validator.escape(String(reasons[banObj.score] || '')) || '[[user:info.banned-no-reason]]'; delete banObj.value; delete banObj.score; @@ -132,4 +132,4 @@ module.exports = function (User) { return banObj; }); } -}; \ No newline at end of file +}; diff --git a/src/views/admin/partials/temporary-ban.tpl b/src/views/admin/partials/temporary-ban.tpl index da8d02c79f..4527e4a739 100644 --- a/src/views/admin/partials/temporary-ban.tpl +++ b/src/views/admin/partials/temporary-ban.tpl @@ -3,7 +3,7 @@