Skip to content

Commit

Permalink
Merge pull request #1 from JavivuG/autofix/alert-9-c5cd00ea87
Browse files Browse the repository at this point in the history
Fix code scanning alert #9: DOM text reinterpreted as HTML
  • Loading branch information
JavivuG authored Sep 23, 2024
2 parents e5a78d4 + efaa2d0 commit a7b9418
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 a7b9418

Please sign in to comment.