test regexp for validity before adding it.

This commit is contained in:
Daniel F 2010-03-19 13:20:50 -04:00
parent f9cc5d5663
commit e2d16cb3a7

View File

@ -167,6 +167,11 @@ class MessageParser(callbacks.Plugin, plugins.ChannelDBHandler):
locked = 0
usage_count = 0
if not locked:
try:
re.compile(regexp)
except Exception, e:
irc.error('Invalid python regexp: %s' % (e,))
return
if ircdb.users.hasUser(msg.prefix):
name = ircdb.users.getUser(msg.prefix).name
else: