aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-08-03 15:20:01 +0000
committerTom Needham <needham.thomas@gmail.com>2012-08-03 15:20:01 +0000
commit21f8646ffc9057bd15fe8a30b781ee20766b5656 (patch)
tree03e63472be620eb6383aa69b01463b8540592379
parent6047a5fe515091d755e964c24de93fc29a5f9754 (diff)
downloadnextcloud-server-21f8646ffc9057bd15fe8a30b781ee20766b5656.tar.gz
nextcloud-server-21f8646ffc9057bd15fe8a30b781ee20766b5656.zip
API: Fix merging of responses. Return 400 error when no OAuth operation sent.
-rw-r--r--lib/api.php10
-rw-r--r--settings/oauth.php4
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/api.php b/lib/api.php
index 90f36aefbcd..c91216179e2 100644
--- a/lib/api.php
+++ b/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);
}
}
}
diff --git a/settings/oauth.php b/settings/oauth.php
index 7f30161d852..f088453a26a 100644
--- a/settings/oauth.php
+++ b/settings/oauth.php
@@ -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;
}