Skip to content

Commit ec49eb3

Browse files
authored
Merge pull request #16805 from raicabogdan/5.0.x-content-type-null
Fix Request::getPostData() when Content-Type is null
2 parents d14d83f + 06431b3 commit ec49eb3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG-5.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Fixed `Phalcon\Http\Request` method `getClientAddress(true)` to return correct IP address from trusted forwarded proxy. [#16777](https://github.com/phalcon/cphalcon/issues/16777)
1616
- Fixed `Phalcon\Http\Request` method `getPost()` to correctly return json data as well and unified both `getPut()` and `getPatch()` to go through the same parsing method. [#16792](https://github.com/phalcon/cphalcon/issues/16792)
1717
- Fixed `Phalcon\Filter\Validation` method `bind()` and `validate()` to correctly bind data when using entity as well as skip binding of fields not included in `$whitelist` [#16800](https://github.com/phalcon/cphalcon/issues/16800)
18+
- Fixed `Phalcon\Http\Request` method `getPostData()` when `Content-Type` header is not set [#16804](https://github.com/phalcon/cphalcon/issues/16804)
1819

1920
### Removed
2021

phalcon/Http/Request.zep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ class Request extends AbstractInjectionAware implements RequestInterface, Reques
18521852
if empty data {
18531853
if this->isJson() {
18541854
let result = this->getJsonRawBody(true);
1855-
} elseif stripos(this->getContentType(), "multipart/form-data") !== false {
1855+
} elseif this->getContentType() && stripos(this->getContentType(), "multipart/form-data") !== false {
18561856
let result = this->getFormData();
18571857
} else {
18581858
// this is more like a fallback to application/x-www-form-urlencoded parsing raw body

0 commit comments

Comments
 (0)