File tree 1 file changed +13
-2
lines changed
app/code/Magento/PageBuilder/view/adminhtml/web/js/resource
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 83
83
} , { } ) ;
84
84
} ;
85
85
86
- function hasShallowProperty ( obj , prop ) {
87
- return ( options . includeInheritedProps || ( typeof prop === 'number' && Array . isArray ( obj ) ) || hasOwnProperty ( obj , prop ) )
86
+ var hasShallowProperty
87
+ if ( options . includeInheritedProps ) {
88
+ hasShallowProperty = function ( ) {
89
+ return true
90
+ }
91
+ } else {
92
+ hasShallowProperty = function ( obj , prop ) {
93
+ return ( typeof prop === 'number' && Array . isArray ( obj ) ) || hasOwnProperty ( obj , prop )
94
+ }
88
95
}
89
96
90
97
function getShallowProperty ( obj , prop ) {
105
112
}
106
113
var currentPath = path [ 0 ] ;
107
114
var currentValue = getShallowProperty ( obj , currentPath ) ;
115
+ if ( options . includeInheritedProps && ( currentPath === '__proto__' ||
116
+ ( currentPath === 'constructor' && typeof currentValue === 'function' ) ) ) {
117
+ throw new Error ( 'For security reasons, object\'s magic properties cannot be set' )
118
+ }
108
119
if ( path . length === 1 ) {
109
120
if ( currentValue === void 0 || ! doNotReplace ) {
110
121
obj [ currentPath ] = value ;
You can’t perform that action at this time.
0 commit comments