瀏覽代碼

Disallow absurdly long reminder lengths.

tags/v0.2
Ben Kurtovic 9 年之前
父節點
當前提交
6dc9d18852
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      earwigbot/commands/remind.py

+ 4
- 0
earwigbot/commands/remind.py 查看文件

@@ -118,6 +118,10 @@ class Remind(Command):
except ValueError:
msg = "Invalid time \x02{0}\x0F. Time must be a positive integer, in seconds."
return self.reply(data, msg.format(data.args[0]))
if wait > 1000 * 365 * 24 * 60 * 60:
# Hard to think of a good upper limit, but 1000 years works.
msg = "Given time \x02{0}\x0F is too large. Keep it reasonable."
return self.reply(data, msg.format(data.args[0]))
message = " ".join(data.args[1:])
try:
rid = self._get_new_id()


Loading…
取消
儲存