aboutsummaryrefslogtreecommitdiffstats
path: root/lib/api.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-12-15 12:37:44 +0000
committerTom Needham <needham.thomas@gmail.com>2012-12-15 12:37:44 +0000
commit39b51997756ebb233be10ca5a8ced0d6c60d0dac (patch)
tree86831673a0910032ce70987d0f88fffec678a7ba /lib/api.php
parent5fe61296981343a3f877618aeecfc33ea7fed3c1 (diff)
downloadnextcloud-server-39b51997756ebb233be10ca5a8ced0d6c60d0dac.tar.gz
nextcloud-server-39b51997756ebb233be10ca5a8ced0d6c60d0dac.zip
API: PUT and DELETE variables are now accessed from the parameters array
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api.php b/lib/api.php
index 84d1155b594..6c6c351b292 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -81,9 +81,9 @@ class OC_API {
public static function call($parameters){
// Prepare the request variables
if($_SERVER['REQUEST_METHOD'] == 'PUT'){
- parse_str(file_get_contents("php://input"), $_PUT);
+ parse_str(file_get_contents("php://input"), $parameters['_put']);
} else if($_SERVER['REQUEST_METHOD'] == 'DELETE'){
- parse_str(file_get_contents("php://input"), $_DELETE);
+ parse_str(file_get_contents("php://input"), $parameters['_delete']);
}
$name = $parameters['_route'];
// Check authentication and availability
@@ -91,7 +91,7 @@ class OC_API {
if(is_callable(self::$actions[$name]['action'])){
$response = call_user_func(self::$actions[$name]['action'], $parameters);
} else {
- $response = new OC_OCS_Result(null, 998, 'Internal server error');
+ $response = new OC_OCS_Result(null, 998, 'Api method not found');
}
} else {
$response = new OC_OCS_Result(null, 997, 'Unauthorised');