diff --git a/app/templates/index.html b/app/templates/index.html index ef2ac03..3cd788b 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -119,6 +119,15 @@ .replace(/"/g, """); } + function safeHttpUrl(url) { + try { + const parsed = new URL(String(url ?? "")); + return parsed.protocol === "http:" || parsed.protocol === "https:" ? parsed.href : null; + } catch { + return null; + } + } + function readCredentialsFromInputs() { return { account_id: document.getElementById("zoom-account-id").value.trim(), @@ -265,11 +274,19 @@ `; } else { + const safeJoinUrl = safeHttpUrl(appt.zoom_join_url); + const safeStartUrl = safeHttpUrl(appt.zoom_start_url); + const joinLinkHtml = safeJoinUrl + ? `${escapeHtml(safeJoinUrl)}` + : `${escapeHtml(appt.zoom_join_url || "No disponible")}`; + const startLinkHtml = safeStartUrl + ? `Abrir como anfitriona (privado)` + : `Enlace no válido`; extraHtml = `