@@ -128,7 +128,7 @@ public function addLink($type, $package, $constraint, $sortPackages = false, $ca
128128 private function sortPackages (array &$ packages = array ())
129129 {
130130 $ prefix = function ($ requirement ) {
131- if (preg_match ( PlatformRepository::PLATFORM_PACKAGE_REGEX , $ requirement )) {
131+ if (PlatformRepository::isPlatformPackage ( $ requirement )) {
132132 return preg_replace (
133133 array (
134134 '/^php/ ' ,
@@ -248,7 +248,7 @@ public function addSubNode($mainNode, $name, $value, $caseInsensitive = false) /
248248 // child exists
249249 $ childRegex = '{ ' .self ::$ DEFINES .'(?P<start>" ' .preg_quote ($ name ).'"\s*:\s*)(?P<content>(?&json))(?P<end>,?)}x ' ;
250250 if ($ this ->pregMatch ($ childRegex , $ children , $ matches )) {
251- $ children = preg_replace_callback ($ childRegex , function ($ matches ) use ($ name , $ subName , $ value , $ that ) {
251+ $ children = preg_replace_callback ($ childRegex , function ($ matches ) use ($ subName , $ value , $ that ) {
252252 if ($ subName !== null ) {
253253 $ curVal = json_decode ($ matches ['content ' ], true );
254254 if (!is_array ($ curVal )) {
@@ -362,6 +362,7 @@ public function removeSubNode($mainNode, $name, $caseInsensitive = false) // WP_
362362 }
363363
364364 // try and find a match for the subkey
365+ $ childrenClean = $ children ;
365366 if ($ this ->pregMatch ('{" ' .preg_quote ($ name ).'"\s*:}i ' , $ children )) {
366367 // find best match for the value of "name"
367368 if (preg_match_all ('{ ' .self ::$ DEFINES .'" ' .preg_quote ($ name ).'"\s*:\s*(?:(?&json))}x ' , $ children , $ matches )) {
@@ -379,8 +380,6 @@ public function removeSubNode($mainNode, $name, $caseInsensitive = false) // WP_
379380 }
380381 }
381382 }
382- } else {
383- $ childrenClean = $ children ;
384383 }
385384
386385 // no child data left, $name was the only key in
0 commit comments