API: Fix merging of responses. Return 400 error when no OAuth operation sent.
This commit is contained in:
parent
6047a5fe51
commit
21f8646ffc
10
lib/api.php
10
lib/api.php
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue