mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-16 23:19:53 -04:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user