mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 03:02:52 +01:00
Fixed bug in ircutils.isNick, which allowed nicks to start with dashes.
This commit is contained in:
parent
14acfcafe4
commit
cede4a4a97
@ -114,10 +114,9 @@ def strEqual(nick1, nick2):
|
||||
|
||||
nickEqual = strEqual
|
||||
|
||||
_nickchars = r'_[]\`^{}|-'
|
||||
nickRe = re.compile(r'^[A-Za-z%s][0-9A-Za-z%s]*$'
|
||||
_nickchars = r'[]\`_^{|}'
|
||||
nickRe = re.compile(r'^[A-Za-z%s][-0-9A-Za-z%s]*$'
|
||||
% (re.escape(_nickchars), re.escape(_nickchars)))
|
||||
|
||||
def isNick(s, strictRfc=True, nicklen=None):
|
||||
"""s => bool
|
||||
Returns True if s is a valid IRC nick."""
|
||||
|
@ -187,6 +187,8 @@ class FunctionsTestCase(SupyTestCase):
|
||||
self.failIf(ircutils.isNick(''))
|
||||
self.failIf(ircutils.isNick('8foo'))
|
||||
self.failIf(ircutils.isNick('10'))
|
||||
self.failIf(ircutils.isNick('-'))
|
||||
self.failIf(ircutils.isNick('-foo'))
|
||||
conf.supybot.protocols.irc.strictRfc.setValue(False)
|
||||
self.failUnless(ircutils.isNick('services@something.undernet.net'))
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user