File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/code/Magento/PageBuilder/view/adminhtml/web/js/resource Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 8383 } , { } ) ;
8484 } ;
8585
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+ }
8895 }
8996
9097 function getShallowProperty ( obj , prop ) {
105112 }
106113 var currentPath = path [ 0 ] ;
107114 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+ }
108119 if ( path . length === 1 ) {
109120 if ( currentValue === void 0 || ! doNotReplace ) {
110121 obj [ currentPath ] = value ;
You can’t perform that action at this time.
0 commit comments