Skip to content

Commit

Permalink
Fix code scanning alert issue-#1345 (#1507)
Browse files Browse the repository at this point in the history
Co-authored-by: DonnieBLT <[email protected]>
  • Loading branch information
JisanAR03 and DonnieBLT authored Oct 28, 2023
1 parent bfd8a3b commit 0eeea11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion website/templates/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ <h3>Comments:</h3>
</div>

<script type="text/javascript">
function sanitizeURL(url) {
var a = document.createElement('a');
a.href = url;
return a.href;
}

var label = "{{object.label}}";

$(document).on('click', '.edit-issue', function (e) {
Expand Down Expand Up @@ -456,7 +462,8 @@ <h3>Comments:</h3>
success: function (data) {
$('.issue-desc').text($('.form input[name=description]').val());
$('.issue-domain').text($('.form input[name=domain]').val());
$('.issue-domain').attr("href", ($('.form input[name=domain]').val()));
var sanitizedDomain = sanitizeURL($('.form input[name=domain]').val());
$('.issue-domain').attr("href", sanitizedDomain);
label = $('.form select').val();
var l = $(".form select option[value='" + label + "']").text();
$('.bug-label').text(l);
Expand Down

0 comments on commit 0eeea11

Please sign in to comment.