Commit 3fa1ebed authored by missionfloyd's avatar missionfloyd

Escape btn_copy_path filename

parent bef51aed
...@@ -10,6 +10,7 @@ from modules.images import read_info_from_image, save_image_with_geninfo ...@@ -10,6 +10,7 @@ from modules.images import read_info_from_image, save_image_with_geninfo
import gradio as gr import gradio as gr
import json import json
import html import html
import re
from fastapi.exceptions import HTTPException from fastapi.exceptions import HTTPException
from modules.infotext_utils import image_from_url_text from modules.infotext_utils import image_from_url_text
...@@ -236,7 +237,7 @@ class ExtraNetworksPage: ...@@ -236,7 +237,7 @@ class ExtraNetworksPage:
) )
onclick = html.escape(onclick) onclick = html.escape(onclick)
btn_copy_path = self.btn_copy_path_tpl.format(**{"filename": item["filename"]}) btn_copy_path = self.btn_copy_path_tpl.format(**{"filename": re.sub(r"[\\\"']", r"\\\g<0>", item["filename"])})
btn_metadata = "" btn_metadata = ""
metadata = item.get("metadata") metadata = item.get("metadata")
if metadata: if metadata:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment