MDL-64511 privacy: encode data URL when loading content.

Previously paths that included ? or # characters would break loading.
This commit is contained in:
Paul Holden 2019-03-27 12:56:16 +00:00
parent 7a5e8583d9
commit 4cf939c638

View file

@ -62,7 +62,7 @@ function loadContent(datafile, callback) {
} }
newscript.type = 'text/javascript'; newscript.type = 'text/javascript';
newscript.src = data; newscript.src = encodeURIComponent(data);
newscript.charset = 'utf-8'; newscript.charset = 'utf-8';
document.getElementsByTagName("head")[0].appendChild(newscript); document.getElementsByTagName("head")[0].appendChild(newscript);
@ -135,4 +135,4 @@ window.$(document).ready(function() {
e.stopPropagation(); e.stopPropagation();
handleClick(window.$(this)); handleClick(window.$(this));
}); });
}); });