Fix for non ascii files in edit mode

This commit is contained in:
ebolam 2022-07-15 12:30:02 -04:00
parent aedd7e966b
commit d91ed3141d
1 changed files with 2 additions and 2 deletions

View File

@ -6198,9 +6198,9 @@ def popup_edit(data):
return
if session['popup_jailed_dir'] is None:
emit("popup_edit_file", {"file": data, "text": open(data, 'r').read()});
emit("popup_edit_file", {"file": data, "text": open(data, 'r', encoding='utf-8').read()});
elif session['popup_jailed_dir'] in data:
emit("popup_edit_file", {"file": data, "text": open(data, 'r').read()});
emit("popup_edit_file", {"file": data, "text": open(data, 'r', encoding='utf-8').read()});
else:
print("User is trying to delete files in your server outside the jail. Blocked. Jailed Dir: {} Requested Dir: {}".format(session['popup_jailed_dir'], data))