Fix 2 DOS vulns, improve Onionr efficiency

This commit is contained in:
Arinerron 2018-06-06 18:54:35 -07:00
parent 9e9595b4ec
commit 1a6fa19323
2 changed files with 10 additions and 3 deletions

View file

@ -469,7 +469,7 @@ class Onionr:
with open(plugins.get_plugins_folder(plugin_name) + '/main.py', 'a') as main:
contents = ''
with open('static-data/default_plugin.py', 'rb') as file:
contents = file.read()
contents = file.read().decode()
# TODO: Fix $user. os.getlogin() is B U G G Y
main.write(contents.replace('$user', 'some random developer').replace('$date', datetime.datetime.now().strftime('%Y-%m-%d')).replace('$name', plugin_name))