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

remotes/origin/stable5
Tom Needham 14 years ago
parent 6047a5fe51
commit 21f8646ffc
  1. 10
      lib/api.php
  2. 4
      settings/oauth.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…
Cancel
Save