Fix injection vulnerability in Block Factories.

Fixes issue #756.
This commit is contained in:
Neil Fraser
2019-08-01 16:36:56 -07:00
committed by Neil Fraser
parent e77a9b7e81
commit ae24b544f3
4 changed files with 12 additions and 12 deletions

View File

@@ -902,9 +902,9 @@ FactoryUtils.defineAndGetBlockTypes = function(blockDefsString, format) {
FactoryUtils.injectCode = function(code, id) {
var pre = document.getElementById(id);
pre.textContent = code;
code = pre.textContent;
code = PR.prettyPrintOne(code, 'js');
pre.innerHTML = code;
// Remove the 'prettyprinted' class, so that Prettify will recalculate.
pre.className = pre.className.replace('prettyprinted', '');
PR.prettyPrint();
};
/**