1
0
mirror of http://aero2k.de/t/repos/urlbot-native.git synced 2017-09-06 15:25:38 +02:00

fix parse_commands(): check array bounds added

This commit is contained in:
urlbot
2014-07-21 03:51:02 +02:00
parent 8aa8485621
commit 6715902005

View File

@@ -75,6 +75,9 @@ def extract_url(data):
def parse_commands(data): def parse_commands(data):
words = data.split(' ') words = data.split(' ')
if 3 > len(words): # need at least two words
return
# reply if beginning of the text matches bot_user # reply if beginning of the text matches bot_user
if words[1][0:len(bot_user)] == bot_user: if words[1][0:len(bot_user)] == bot_user:
chat_write(words[0][1:-1] + ''': I'm a bot, my job is to extract <title> tags from posted URLs. In case I'm annoying or for further questions, please talk to my master Cae.''') chat_write(words[0][1:-1] + ''': I'm a bot, my job is to extract <title> tags from posted URLs. In case I'm annoying or for further questions, please talk to my master Cae.''')