fix(gateway): reject file paths in get_command() + file-drop tests (#7356)

Gateway get_command() now rejects paths containing /. Also adds 28 _detect_file_drop regression tests. From #6978 (@ygd58) and #6963 (@betamod).
This commit is contained in:
Teknium 2026-04-10 13:06:02 -07:00 committed by GitHub
parent 37a1c75716
commit 360b21ce95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 179 additions and 0 deletions

View file

@ -613,6 +613,9 @@ class MessageEvent:
raw = parts[0][1:].lower() if parts else None
if raw and "@" in raw:
raw = raw.split("@", 1)[0]
# Reject file paths: valid command names never contain /
if raw and "/" in raw:
return None
return raw
def get_command_args(self) -> str: