Skip to content
Snippets Groups Projects
Commit 2f84a8d7 authored by Tom Needham's avatar Tom Needham
Browse files

Merge the responses recursively

parent c4d87c1a
Branches
No related tags found
No related merge requests found
......@@ -86,7 +86,6 @@ class OC_API {
$finalresponse = array();
$numresponses = count($responses);
// TODO - This is only a temporary merge. If keys match and value is another array we want to compare deeper in the array
foreach($responses as $response){
if(is_int($response) && empty($finalresponse)){
$finalresponse = $response;
......@@ -95,13 +94,12 @@ class OC_API {
if(is_array($response)){
// Shipped apps win
if(OC_App::isShipped($response['app'])){
$finalresponse = array_merge($finalresponse, $response);
$finalresponse = array_merge_recursive($finalresponse, $response);
} else {
$finalresponse = array_merge($response, $finalresponse);
$finalresponse = array_merge_recursive($response, $finalresponse);
}
}
}
// END TODO
return $finalresponse;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment