diff options
| author | 2018-03-16 22:24:06 +0100 | |
|---|---|---|
| committer | 2018-03-16 22:24:06 +0100 | |
| commit | 4fdc42a1b47a366414abb2df8a0e1df9e72add55 (patch) | |
| tree | bcf9d2cfb610a3d0567040a96ec6785bacc8bbd1 | |
| parent | Update README.md (diff) | |
Fix the catastrophic backtracking caused by Nix
| -rw-r--r-- | bot/cogs/bot.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py index 600285cf6..3ceebd6ab 100644 --- a/bot/cogs/bot.py +++ b/bot/cogs/bot.py @@ -88,7 +88,7 @@ class Bot: """ if msg.count("\n") >= 3: # Filtering valid Python codeblocks and exiting if a valid Python codeblock is found - if re.search("```(python|py)\n((?:.*\n*)+)```", msg, re.IGNORECASE): + if re.search("```(?:py|python)\n(.*?)```", msg, re.IGNORECASE | re.DOTALL): log.trace("Someone wrote a message that was already a " "valid Python syntax highlighted code block. No action taken.") return None |