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

API: Fix merging of responses. Return 400 error when no OAuth operation sent.

parent 6047a5fe
No related branches found
No related tags found
No related merge requests found
......@@ -107,16 +107,16 @@ class OC_API {
$numresponses = count($responses);
foreach($responses as $response){
if(is_int($response) && empty($finalresponse)){
$finalresponse = $response;
if(is_int($response['response']) && empty($finalresponse)){
$finalresponse = $response['response'];
continue;
}
if(is_array($response)){
if(is_array($response['response'])){
// Shipped apps win
if(OC_App::isShipped($response['app'])){
$finalresponse = array_merge_recursive($finalresponse, $response);
$finalresponse = array_merge_recursive($finalresponse, $response['response']);
} else {
$finalresponse = array_merge_recursive($response, $finalresponse);
$finalresponse = array_merge_recursive($response['response'], $finalresponse);
}
}
}
......
......@@ -76,8 +76,8 @@ switch($operation){
}
break;
default:
// Something went wrong
header('Location: /');
// Something went wrong, we need an operation!
OC_Response::setStatus(400);
break;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment