Hotfix: HTML escaped story output. Shodan can no longer run JS popups in your browser.

This commit is contained in:
KoboldAI Dev 2021-06-02 09:01:13 -04:00
parent de1f8f94e0
commit 1e95f7e1a5
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import tkinter as tk
from tkinter import messagebox from tkinter import messagebox
import json import json
import requests import requests
import html
# KoboldAI # KoboldAI
import fileops import fileops
@ -1092,7 +1093,7 @@ def applyoutputformatting(txt):
def refresh_story(): def refresh_story():
text_parts = ['<chunk n="0" id="n0">', vars.prompt, '</chunk>'] text_parts = ['<chunk n="0" id="n0">', vars.prompt, '</chunk>']
for idx, item in enumerate(vars.actions, start=1): for idx, item in enumerate(vars.actions, start=1):
text_parts.extend(('<chunk n="', str(idx), '" id="n', str(idx), '">', item, '</chunk>')) text_parts.extend(('<chunk n="', str(idx), '" id="n', str(idx), '">', html.escape(item), '</chunk>'))
emit('from_server', {'cmd': 'updatescreen', 'data': formatforhtml(''.join(text_parts))}) emit('from_server', {'cmd': 'updatescreen', 'data': formatforhtml(''.join(text_parts))})
#==================================================================# #==================================================================#