mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
security: fix XSS for malicioius URLs #114
This commit is contained in:
parent
788823920c
commit
2117fefe62
1 changed files with 2 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue