mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-24 21:46:43 -05:00
fixed bug involving global variables not getting set correctly, making strings not display in html
This commit is contained in:
parent
62a309fdb8
commit
25b55093be
@ -27,7 +27,7 @@ filename = filehash = filesize = ''
|
|||||||
|
|
||||||
@app.route("/{0}".format(slug))
|
@app.route("/{0}".format(slug))
|
||||||
def index():
|
def index():
|
||||||
global filename, filesize, filehash, slug
|
global filename, filesize, filehash, slug, strings
|
||||||
return render_template_string(open('{0}/index.html'.format(os.path.dirname(__file__))).read(),
|
return render_template_string(open('{0}/index.html'.format(os.path.dirname(__file__))).read(),
|
||||||
slug=slug, filename=os.path.basename(filename), filehash=filehash, filesize=filesize, strings=strings)
|
slug=slug, filename=os.path.basename(filename), filehash=filehash, filesize=filesize, strings=strings)
|
||||||
|
|
||||||
@ -78,6 +78,7 @@ def load_strings(default="en"):
|
|||||||
strings = translated[lang]
|
strings = translated[lang]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
global filename, filehash, filesize
|
||||||
load_strings()
|
load_strings()
|
||||||
|
|
||||||
# validate filename
|
# validate filename
|
||||||
@ -140,3 +141,6 @@ def main():
|
|||||||
|
|
||||||
# shutdown
|
# shutdown
|
||||||
tails_close_port(port)
|
tails_close_port(port)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user