Hardened the help command against escaping its directory.
parent
5095a254aa
commit
87b7a15c5a
|
@ -83,7 +83,7 @@ def on_message(message):
|
|||
if (command is '' ):
|
||||
helpfile = open(cwd + "/helpcommand.txt","r")
|
||||
yield from client.send_message(message.channel, helpfile.read())
|
||||
elif os.path.isfile(cwd + "/helptext/" + command):
|
||||
elif re.match("^[A-Za-z0-9_-]*$", command) and os.path.isfile(cwd + "/helptext/" + command):
|
||||
commandhelp = open(cwd + "/helptext/" + command,"r")
|
||||
yield from client.send_message(message.channel, commandhelp.read())
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue