Skip to content

Commit

Permalink
mitigate pot. prototype pollution problem
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietrich committed Aug 8, 2024
1 parent 7f5d3d5 commit d85f8ac
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 d85f8ac

Please sign in to comment.