From 7772431cb76426ce0d660063b543179ce6693f40 Mon Sep 17 00:00:00 2001 From: ElyPrism Date: Fri, 6 Feb 2026 20:00:36 +0800 Subject: [PATCH] fix: Potential fix for code scanning alert no. 6: DOM text reinterpreted as HTML Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- public/audio_match_demo/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/audio_match_demo/index.html b/public/audio_match_demo/index.html index 713510f..b5e7eb4 100644 --- a/public/audio_match_demo/index.html +++ b/public/audio_match_demo/index.html @@ -232,7 +232,11 @@ let canvas = document.getElementById('canvas') let canvasCtx = canvas.getContext('2d') let logs = document.getElementById('logs') - logs.write = line => logs.innerHTML += line + '\n' + logs.write = line => { + // Append log lines as text to avoid interpreting content as HTML + logs.appendChild(document.createTextNode(line)); + logs.appendChild(document.createElement('br')); + } function RecorderCallback(channelL) { let sampleBuffer = new Float32Array(channelL.subarray(0, duration * 8000))