Skip to content

Commit

Permalink
Merge pull request #3122 from eclipse/cd-mit-heap-poll
Browse files Browse the repository at this point in the history
mitigate pot. prototype pollution problem
  • Loading branch information
cdietrich authored Aug 18, 2024
2 parents d03e0c2 + d85f8ac commit 01fced3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion org.eclipse.xtext.web.example.jetty/src/main/webapp/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@
function mixin(target, source, force) {
var prop;
for (prop in source) {
if (source.hasOwnProperty(prop) && (!target.hasOwnProperty(prop) || force)) {
if (prop === '__proto__' || prop === 'constructor') {
continue; // Skip these properties
}
if (Object.prototype.hasOwnProperty.call(source, prop) && (!Object.prototype.hasOwnProperty.call(target, prop) || force)) {
target[prop] = source[prop];
} else if (typeof source[prop] === 'object') {
if (!target[prop] && source[prop]) {
Expand Down

0 comments on commit 01fced3

Please sign in to comment.