This commit is contained in:
Jeremy Fincher 2003-11-25 22:52:04 +00:00
parent a524d72cc1
commit 23968baf49
2 changed files with 8 additions and 0 deletions

View File

@ -123,6 +123,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
if s: if s:
try: try:
tokens = callbacks.tokenize(s) tokens = callbacks.tokenize(s)
if tokens and isinstance(tokens[0], list):
s = 'The command called may not be the result ' \
'of a nested command.'
irc.queueMsg(callbacks.error(msg, s))
return
except SyntaxError, e: except SyntaxError, e:
irc.queueMsg(callbacks.error(msg, str(e))) irc.queueMsg(callbacks.error(msg, str(e)))
return return

View File

@ -320,6 +320,9 @@ class PrivmsgTestCase(ChannelPluginTestCase):
self.assertError('load [foo') self.assertError('load [foo')
self.assertError('load foo]') self.assertError('load foo]')
def testNoEscapingAttributeErrorFromTokenizeWithFirstElementList(self):
self.assertError('[plugin list] list')
class PrivmsgCommandAndRegexpTestCase(PluginTestCase): class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
plugins = ('Utilities',) # Gotta put something. plugins = ('Utilities',) # Gotta put something.