mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-03 19:07:42 +01:00
Fix for non ascii files in edit mode
This commit is contained in:
parent
aedd7e966b
commit
d91ed3141d
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user