Skip to content

Commit

Permalink
Fix code scanning alert #9: DOM text reinterpreted as HTML
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
huglope and github-advanced-security[bot] authored Sep 19, 2024
1 parent 36e4019 commit efaa2d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/webapp/scripts/create_new_topic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function toggleModal() {
action.addEventListener('click', function() {
var result = parseInt(this.dataset.confirm);
if (result === 1) {
var title = document.getElementById('title').value;
var message = document.getElementById('message').value;
var title = encodeURIComponent(document.getElementById('title').value);
var message = encodeURIComponent(document.getElementById('message').value);
let queryString = window.location.search;
let urlParams = new URLSearchParams(queryString);
var idForo = urlParams.get('idForo');
window.location.href = '/CreateTopic?idForo=' + idForo + '&title='+title+'&message='+message;
window.location.href = '/CreateTopic?idForo=' + idForo + '&title=' + title + '&message=' + message;
} else {
wrapper.classList.remove('active');
setTimeout(function() {
Expand Down

0 comments on commit efaa2d0

Please sign in to comment.