Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject multiline chat messages attempting to watch/blacklist keywords #12736

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions chatcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@ def get_normalized_on_list(list_type, extra=''):
text_before_pattern = ''
text_after_pattern = ''

# Block multiline chat messages to avoid corrupting the watchlist/blacklist file(s)
# Using -force should not bypass this, as that still results in file corruption
if '\n' in pattern:
raise CmdException("The watchlist/blacklist cannot be modified using multiline chat messages. If"
" your desired change exceeds the length of a standard chat message, consider"
" using Git to make the change (or ping someone who can).")

other_issues = []
if '\u202d' in pattern:
other_issues.append("The pattern contains an invisible U+202D whitespace character.")
Expand Down