Skip to content

Commit

Permalink
Merge pull request #216 from funklos/patch-1
Browse files Browse the repository at this point in the history
close #204 Escaping script tags
  • Loading branch information
zloirock authored Jul 9, 2016
2 parents 60a946b + 3ff99ed commit 70f0841
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/_object-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var createDict = function(){
// Thrash, waste and sodomy: IE GC bug
var iframe = require('./_dom-create')('iframe')
, i = enumBugKeys.length
, lt = '<'
, gt = '>'
, iframeDocument;
iframe.style.display = 'none';
Expand All @@ -20,7 +21,7 @@ var createDict = function(){
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write('<script>document.F=Object</script' + gt);
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
Expand All @@ -37,4 +38,4 @@ module.exports = Object.create || function create(O, Properties){
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
};

0 comments on commit 70f0841

Please sign in to comment.