FHCAPI Controller: multipart upload

This commit is contained in:
cgfhtw
2024-02-20 08:38:29 +01:00
parent 013664db70
commit 72d166a050
2 changed files with 43 additions and 0 deletions
+4
View File
@@ -89,6 +89,10 @@ 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), true);
elseif (isset($_POST['_jsondata'])) {
$_POST = array_merge($_POST, json_decode($_POST['_jsondata'], true));
unset($_POST['_jsondata']);
}
}