Skip to content

Commit

Permalink
Merge pull request #72 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
Freezing objects is optional, CONFIG.set secureObjects = false to dis…
  • Loading branch information
jeanmachuca committed Jun 8, 2021
2 parents 34bb6f8 + 90d210d commit c05540f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4051,13 +4051,18 @@
}

/* Freezing Object && Object.prototype to prevent prototype pollution risks */
(function (){
if (CONFIG.get("secureObjects", true)){
Object.freeze(Object.prototype);
Object.freeze(Object);
}
})();

(function (isBrowser){
var __freeze__ = function (){
Object.freeze(Object.prototype);
Object.freeze(Object);
}
if (isBrowser && CONFIG.get("secureObjects", true)){
window.addEventListener("DOMContentLoaded", __freeze__);
} else if (CONFIG.get("secureObjects", true)) {
__freeze__();
}
})(isBrowser);

}).call(null,(typeof module === "object" && typeof module.exports === "object")?(module.exports = global):((typeof global === "object")?(global):(
(typeof window === "object")?(window):({})
)));

0 comments on commit c05540f

Please sign in to comment.