Added sanitize_svg function and forbid_remote_access is used for setting personality settings

This commit is contained in:
Saifeddine ALOUI 2024-05-19 17:38:45 +02:00
parent 4e85868276
commit 6508946102
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ from starlette.responses import StreamingResponse
from lollms.types import MSG_TYPE
from lollms.main_config import BaseConfig
from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception, show_yes_no_dialog, add_period
from lollms.security import sanitize_path, forbid_remote_access, check_access
from lollms.security import sanitize_path, forbid_remote_access, check_access, sanitize_svg
from ascii_colors import ASCIIColors
from lollms.databases.discussions_database import DiscussionsDB
from lollms.client_session import Client
@ -104,7 +104,7 @@ async def execute_code(request: CodeRequest):
if language=="svg":
ASCIIColors.info("Executing svg code:")
ASCIIColors.yellow(code)
return execute_svg(code, client, message_id)
return execute_svg(sanitize_svg(code), client, message_id)
if language=="javascript":
ASCIIColors.info("Executing javascript code:")
ASCIIColors.yellow(code)

@ -1 +1 @@
Subproject commit 104293d5e922d0631f307e23da30069efcc8e2de
Subproject commit eda3af5f5c4ea9b2f3569f72f8d05989e29367fc