mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
raw_input_stream as array instead of stdobj & terminateWithSuccess
This commit is contained in:
@@ -87,7 +87,7 @@ class FHCAPI_Controller extends FHC_Controller
|
||||
|
||||
// For JSON Requests (as opposed to multipart/form-data) get the $_POST variable from the input stream instead
|
||||
if ($this->input->get_request_header('Content-Type', true) == 'application/json')
|
||||
$_POST = json_decode($this->security->xss_clean($this->input->raw_input_stream));
|
||||
$_POST = json_decode($this->security->xss_clean($this->input->raw_input_stream), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,6 +159,17 @@ class FHCAPI_Controller extends FHC_Controller
|
||||
exit(EXIT_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data (optional)
|
||||
* @return void
|
||||
*/
|
||||
protected function terminateWithSuccess($data = null)
|
||||
{
|
||||
$this->setData($data);
|
||||
$this->setStatus(self::STATUS_SUCCESS);
|
||||
exit;
|
||||
}
|
||||
|
||||
// TODO(chris): complete list
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user