aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ionite34 <[email protected]>2022-12-20 17:22:41 +0800
committerGravatar ionite34 <[email protected]>2022-12-20 17:22:41 +0800
commit48cf627b37e48bdce15312c0981347e6e2b10622 (patch)
treef394e2ade054f9c2d5b78489e72187d9416fc0ff
parentRename method get_failed_files_str (diff)
Add markdown mention escape for file error str
-rw-r--r--bot/exts/utils/snekbox/_eval.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/utils/snekbox/_eval.py b/bot/exts/utils/snekbox/_eval.py
index afbb4a32d..95039f0bd 100644
--- a/bot/exts/utils/snekbox/_eval.py
+++ b/bot/exts/utils/snekbox/_eval.py
@@ -5,6 +5,8 @@ from dataclasses import dataclass, field
from signal import Signals
from typing import TYPE_CHECKING
+from discord.utils import escape_markdown, escape_mentions
+
from bot.exts.utils.snekbox._io import FILE_COUNT_LIMIT, FILE_SIZE_LIMIT, FileAttachment, sizeof_fmt
from bot.log import get_logger
@@ -110,6 +112,9 @@ class EvalResult:
break
names.append(file)
text = ", ".join(names)
+ # Since the file names are provided by user
+ text = escape_markdown(text)
+ text = escape_mentions(text)
return text
def get_message(self, job: EvalJob) -> str: