security: fix XSS for malicioius URLs #114

This commit is contained in:
Sören Weber 2021-10-08 19:30:27 +02:00
parent 788823920c
commit 2117fefe62
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -510,10 +510,8 @@ jQuery(function() {
var element = $(this); var element = $(this);
var url = encodeURI(document.location.origin + document.location.pathname); var url = encodeURI(document.location.origin + document.location.pathname);
var link = url + "#"+element[0].id; var link = url + "#"+element[0].id;
return " <span class='anchor' data-clipboard-text='"+link+"'>" + var html = " " + $( "<span>" ).addClass("anchor").attr("data-clipboard-text", link).append("<i class='fas fa-link fa-lg'></i>").get(0).outerHTML;
"<i class='fas fa-link fa-lg'></i>" + return html;
"</span>"
;
}); });
$(".anchor").on('mouseleave', function(e) { $(".anchor").on('mouseleave', function(e) {