mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
utils: don't allow hostmasks/banmasks to have # in them
This commit is contained in:
parent
4323c19c40
commit
b8fe622cc8
3
utils.py
3
utils.py
@ -159,7 +159,8 @@ def isServerName(s):
|
|||||||
hostmaskRe = re.compile(r'^\S+!\S+@\S+$')
|
hostmaskRe = re.compile(r'^\S+!\S+@\S+$')
|
||||||
def isHostmask(text):
|
def isHostmask(text):
|
||||||
"""Returns whether the given text is a valid hostmask."""
|
"""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):
|
def parseModes(irc, target, args):
|
||||||
"""Parses a modestring list into a list of (mode, argument) tuples.
|
"""Parses a modestring list into a list of (mode, argument) tuples.
|
||||||
|
Loading…
Reference in New Issue
Block a user