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>
This commit is contained in:
ElyPrism 2026-02-06 20:00:36 +08:00 committed by GitHub
parent c2871322d0
commit 7772431cb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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))