3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

utils: don't allow hostmasks/banmasks to have # in them

This commit is contained in:
James Lu 2015-10-08 17:25:17 -07:00
parent 4323c19c40
commit b8fe622cc8

View File

@ -159,7 +159,8 @@ def isServerName(s):
hostmaskRe = re.compile(r'^\S+!\S+@\S+$')
def isHostmask(text):
"""Returns whether the given text is a valid hostmask."""
return bool(hostmaskRe.match(text))
# Band-aid patch here to prevent bad bans set by Janus forwarding people into invalid channels.
return hostmaskRe.match(text) and '#' not in text
def parseModes(irc, target, args):
"""Parses a modestring list into a list of (mode, argument) tuples.