From 2e221a84cce04f23251fa7c78a4e0a010c070b5d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 18 Dec 2009 14:59:44 -0800 Subject: Change how request input is processed.First the input is no longer json encode, All the get variables are loaded, then the post variables if the request is a post, and then the path is extracted from the uri. --- modules/rest/controllers/rest.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'modules/rest/controllers') diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php index 0a39e02c..d1404b29 100644 --- a/modules/rest/controllers/rest.php +++ b/modules/rest/controllers/rest.php @@ -68,17 +68,13 @@ class Rest_Controller extends Controller { private function _normalize_request($args=array()) { $method = strtolower($this->input->server("REQUEST_METHOD")); + $request = new stdClass(); + foreach (array_keys($this->input->get()) as $key) { + $request->$key = $this->input->get($key); + } if ($method != "get") { - $request = $this->input->post("request", null); - if ($request) { - $request = json_decode($request); - } else { - $request = new stdClass(); - } - } else { - $request = new stdClass(); - foreach (array_keys($this->input->get()) as $key) { - $request->$key = $this->input->get($key); + foreach (array_keys($this->input->post()) as $key) { + $request->$key = $this->input->post($key); } } -- cgit v1.2.3