Upgrading Issue from 5.1.4 to 5.4.0 in PHP 7.4: Problems with PUT Data Retrieval in application/x-www-form-urlencoded ContentType #16519
Description
Discussed in https://github.com/orgs/phalcon/discussions/16513
Originally posted by baohanddd January 14, 2024
I encountered a problem after upgrading from 5.1.4 to 5.4.0 on PHP 7.4. I am unable to retrieve PUT data, which is always empty, but reverting back to version 5.1.4 resolves the issue. Currently, the project is using the ContentType application/x-www-form-urlencoded.
var_dump($_SERVER['HTTP_CONTENT_TYPE']);
var_dump($this->request->getPut());
exit;
The Result:
string(33) "application/x-www-form-urlencoded"
array(0) {
}
I looked into the code for both 5.1.4 and 5.4.0 and found the issue seems to be with the getPatchPut() function.
getPatchPut in 5.4.0:
I'm not sure if version 5.4.0 no longer supports application/x-www-form-urlencoded, or is there a way to make PUT work under x-www-form-urlencoded?
Metadata
Assignees
Type
Projects
Status
Released