From c32f4350def839a1b98f49fd2b0adea6c4c0968a Mon Sep 17 00:00:00 2001 From: Tony Averty Date: Wed, 21 Oct 2026 16:10:05 +0200 Subject: [PATCH] fix: only render http(s) links from scraped prospect data Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SfihHazrSHXgndJtSNLubJ --- public/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index 4dddb33..4a53c7d 100644 --- a/public/app.js +++ b/public/app.js @@ -357,6 +357,9 @@ // ---------- Liste des prospects (mini CRM) ---------- const STATUS = { new: 'À contacter', sent: 'Contacté', replied: 'A répondu', client: 'Client', refused: 'Refus', bounced: 'Rejeté' }; + // Seuls les liens http(s) sont cliquables : un "javascript:" venu d'une page web scrapée ne doit jamais s'exécuter ici + const safeUrl = (u) => (/^https?:\/\//i.test(String(u || '')) ? String(u) : ''); + const fmtDay = (ts) => (ts ? new Date(ts * 1000).toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', timeZone: 'Europe/Paris' }) : ''); async function loadProspects(d, page = 1) { @@ -367,7 +370,7 @@ const r = await api(`/api/projects/${proj.dataset.id}/prospects?${qs}`); d.dataset.page = r.page; box.innerHTML = r.rows.length ? `
- ${r.rows.map((x) => ` + ${r.rows.map((x) => ``).join('')}
EntrepriseEmailVilleScoreContactéStatut
${x.website ? `${esc(x.company)}` : esc(x.company)}
${safeUrl(x.website) ? `${esc(x.company)}` : esc(x.company)} ${esc(x.email)}${esc(x.city)}${x.score ?? ''} ${fmtDay(x.sent_at)}${x.followup_at ? ' + relance' : ''}