Merge branch 'fronkdev' into 'master'

Added API endpoint PUT /preorder/{id} to update contact data

See merge request fronk/thetool!1781
This commit is contained in:
Frank Schubert
2025-09-19 12:27:09 +00:00
4 changed files with 262 additions and 3 deletions

View File

@@ -185,7 +185,7 @@ class mfBaseApicontroller {
// POST Request
$post = [];
if($this->http_method == "POST") {
if($this->http_method == "POST" || $this->http_method == "PUT") {
$post = $this->getPostRequest();
if($post === false) {
$post = [];
@@ -234,6 +234,11 @@ class mfBaseApicontroller {
return $request_body;
}
if($this->http_method == "PUT") {
// PUT requests in application/x-www-form-urlencoded format need special handling
parse_str(file_get_contents("php://input"), $_POST);
}
// Request body is urlencoded or multipart-formdata
if(array_key_exists("CONTENT_TYPE", $_SERVER) && preg_match('#charset\s*=\s*["\']?([^ "\']+)["\']?\s*;?#i', $_SERVER["CONTENT_TYPE"], $m)) {
$request_charset = strtolower($m[1]);