Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert #20: DOM text reinterpreted as HTML #28

Merged
merged 5 commits into from
Sep 20, 2024
Merged
5 changes: 4 additions & 1 deletion fj-tech/src/js/voluntarios/festival/resgate_voucher.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ document.getElementById("corpoTabelaDeListagemDeVoluntarios").addEventListener("
console.log("Voucher resgatado com sucesso");

// Exibe o tipo de voucher resgatado pelo voluntário
txtResgateVoucher.innerHTML = `<small class="opacity-50 m-0 px-4">Voucher resgatado: ${tipoVoucherDoVoluntario}</small>`;
const smallElement = document.createElement('small');
Tech-FestivalDoJapao marked this conversation as resolved.
Show resolved Hide resolved
smallElement.className = 'opacity-50 m-0 px-4';
Tech-FestivalDoJapao marked this conversation as resolved.
Show resolved Hide resolved
smallElement.textContent = `Voucher resgatado: ${tipoVoucherDoVoluntario}`;
Tech-FestivalDoJapao marked this conversation as resolved.
Show resolved Hide resolved
txtResgateVoucher.appendChild(smallElement);
Tech-FestivalDoJapao marked this conversation as resolved.
Show resolved Hide resolved
bloquearResgateVoucher();
}).catch((erro) => {
console.error("Erro ao resgatar voucher: ", erro);
Expand Down