Skip to content

Commit 27a6b57

Browse files
committed
Make sure to compare casefolded versions of user host masks
1 parent 931caf7 commit 27a6b57

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

plugins/ignore.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ def remove_ignore(db, conn, chan, mask):
5050

5151

5252
def is_ignored(conn, chan, mask):
53+
mask_cf = mask.casefold()
5354
for _conn, _chan, _mask in ignore_cache:
55+
_mask_cf = _mask.casefold()
5456
if _chan == "*":
5557
# this is a global ignore
56-
if fnmatch(mask, _mask):
58+
if fnmatch(mask_cf, _mask_cf):
5759
return True
5860
else:
5961
# this is a channel-specific ignore
6062
if not (conn, chan) == (_conn, _chan):
6163
continue
62-
if fnmatch(mask, _mask):
64+
if fnmatch(mask_cf, _mask_cf):
6365
return True
6466

6567

@@ -84,8 +86,7 @@ def ignore_sieve(bot, event, _hook):
8486
# this is a server message, we don't need to check it
8587
return event
8688

87-
mask = event.mask.lower()
88-
if is_ignored(event.conn.name, event.chan, mask):
89+
if is_ignored(event.conn.name, event.chan, event.mask):
8990
return None
9091

9192
return event

0 commit comments

Comments
 (0)