diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-27 13:05:57 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-27 14:22:35 +0100 |
commit | 5c2fafa05faf532ab6e7ccde0ffadd8c984671fb (patch) | |
tree | 401efa60f8a0f558be1cb7ca0016b2a2b316e4f6 /lib/private/api.php | |
parent | 8abb80c64277524fadcbea875e2d559c339ef0b1 (diff) | |
download | nextcloud-server-5c2fafa05faf532ab6e7ccde0ffadd8c984671fb.tar.gz nextcloud-server-5c2fafa05faf532ab6e7ccde0ffadd8c984671fb.zip |
Read from IRequest instead of reading twice
Potentially fixes https://github.com/owncloud/core/issues/14541 and https://github.com/owncloud/core/issues/14506
Diffstat (limited to 'lib/private/api.php')
-rw-r--r-- | lib/private/api.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/api.php b/lib/private/api.php index c58d2620684..804d9346842 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -84,11 +84,13 @@ class OC_API { * @param array $parameters */ public static function call($parameters) { + $request = \OC::$server->getRequest(); + // Prepare the request variables - if($_SERVER['REQUEST_METHOD'] == 'PUT') { - parse_str(file_get_contents("php://input"), $parameters['_put']); - } else if($_SERVER['REQUEST_METHOD'] == 'DELETE') { - parse_str(file_get_contents("php://input"), $parameters['_delete']); + if($request->getMethod() === 'PUT') { + $parameters['_put'] = $request->getParams(); + } else if($request->getMethod() === 'DELETE') { + $parameters['_delete'] = $request->getParams(); } $name = $parameters['_route']; // Foreach registered action |