From 1ddc8ccbf4719d194edd3d80b105d125078e380f Mon Sep 17 00:00:00 2001 From: Sora <8521327+SoraKasvgano@users.noreply.github.com> Date: Tue, 20 Jan 2026 10:20:10 +0800 Subject: [PATCH] Use template.JS for ShareInfo and APlayerScript Wrap ShareInfo and APlayerScript with template.JS to ensure they are safely injected as JavaScript in templates, preventing potential escaping issues. --- server/public/handle_shares.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/public/handle_shares.go b/server/public/handle_shares.go index e1d017831..7e24e3bae 100644 --- a/server/public/handle_shares.go +++ b/server/public/handle_shares.go @@ -183,8 +183,8 @@ func (pub *Router) handleAPlayer(w http.ResponseWriter, r *http.Request) { data := map[string]interface{}{ "ShareDescription": description, - "ShareInfo": string(shareInfoJSON), - "APlayerScript": string(scriptContent), + "ShareInfo": template.JS(shareInfoJSON), + "APlayerScript": template.JS(scriptContent), "BaseURL": baseURL, }