From 03be6bb67fc5a2348f10c17b196d130af19d75f4 Mon Sep 17 00:00:00 2001 From: type-two Date: Thu, 25 Jun 2026 01:11:38 +1000 Subject: [PATCH] fix(admin): escapeH crashed on numbers (intake search cards) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Intake 'Find & stage' renders it.year (an int) through escapeH → (1977).replace is not a function → the whole results render threw. escapeH now coerces via String() so numbers/null are safe everywhere. Co-Authored-By: Claude Opus 4.8 --- site/admin.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/admin.html b/site/admin.html index d5b954e..f9e1376 100644 --- a/site/admin.html +++ b/site/admin.html @@ -834,7 +834,7 @@ async function mapFind(){ // ---------- helpers ---------- function vSoon(title, body){ return () => { $('#content').innerHTML = `

${title}

${body}

Coming next.
`; }; } -function escapeH(s){ return (s||'').replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c])); } +function escapeH(s){ return (s==null?'':String(s)).replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c])); } if(TOKEN){ $('#tok').value = TOKEN; signin(); }