File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
lib/internal/Magento/Framework/App/Config Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class Data implements DataInterface
2929 */
3030 public function __construct (MetadataProcessor $ processor , array $ data )
3131 {
32- $ this ->_data = $ processor ->process ($ data );
32+ /** Clone the array to work around a kink in php7 that modifies the argument by reference */
33+ $ this ->_data = $ processor ->process ($ this ->_arrayClone ($ data ));
3334 $ this ->_source = $ data ;
3435 }
3536
@@ -77,4 +78,19 @@ public function setValue($path, $value)
7778 }
7879 $ currentElement [$ lastKey ] = $ value ;
7980 }
81+
82+ /**
83+ * Copy array by value
84+ *
85+ * @param array $data
86+ * @return array
87+ */
88+ private function _arrayClone (array $ data )
89+ {
90+ $ clone = [];
91+ foreach ($ data as $ key => $ value ) {
92+ $ clone [$ key ]= $ value ;
93+ }
94+ return $ clone ;
95+ }
8096}
You can’t perform that action at this time.
0 commit comments