Merge pull request #182 from jmaxallen/xss-fix

xss fix
This commit is contained in:
Matthew Taylor 2018-10-17 14:30:01 -04:00 committed by GitHub
commit c8e6161b21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,7 @@ jQuery(document).ready(function() {
var text, clip = new Clipboard('.anchor');
$("h1~h2,h1~h3,h1~h4,h1~h5,h1~h6").append(function(index, html){
var element = $(this);
var url = document.location.origin + document.location.pathname;
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>" +