Skip to content

Commit

Permalink
security: fix XSS for malicioius URLs #114
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Oct 8, 2021
1 parent 7888239 commit 2117fef
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions static/js/relearn.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,8 @@ jQuery(function() {
var element = $(this);
var url = encodeURI(document.location.origin + document.location.pathname);
var link = url + "#"+element[0].id;
return " <span class='anchor' data-clipboard-text='"+link+"'>" +
"<i class='fas fa-link fa-lg'></i>" +
"</span>"
;
var html = " " + $( "<span>" ).addClass("anchor").attr("data-clipboard-text", link).append("<i class='fas fa-link fa-lg'></i>").get(0).outerHTML;
return html;
});

$(".anchor").on('mouseleave', function(e) {
Expand Down

0 comments on commit 2117fef

Please sign in to comment.