Skip to content

Commit

Permalink
Prevent crashes with :3
Browse files Browse the repository at this point in the history
No reasonable chat message ID would have less than 6 digits (that takes us to 2010-ish)
  • Loading branch information
csnardi committed May 27, 2016
1 parent 7612277 commit 2965e8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chatcommunicate.py
Expand Up @@ -168,7 +168,7 @@ def handle_commands(content_lower, message_parts, ev_room, ev_room_name, ev_user
second_part_lower = "tpu-"
if second_part_lower == "n":
second_part_lower = "naa-"
if re.compile("^:[0-9]+$").search(message_parts[0]):
if re.compile("^:[0-9]{6,}$").search(message_parts[0]):
msg_id = int(message_parts[0][1:])
msg = wrap2.get_message(msg_id)
msg_content = msg.content_source
Expand Down

0 comments on commit 2965e8e

Please sign in to comment.