mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
Automatically handle PUT requests
make the following "just work" curl -X PUT -d foo=bar http://...
This commit is contained in:
parent
d1475b1fd3
commit
b509bdb04b
2 changed files with 110 additions and 2 deletions
|
@ -161,7 +161,14 @@ class CakeRequest implements ArrayAccess {
|
|||
* @return void
|
||||
*/
|
||||
protected function _processPost() {
|
||||
$this->data = $_POST;
|
||||
if ($_POST) {
|
||||
$this->data = $_POST;
|
||||
} elseif ($this->is('put')) {
|
||||
$this->data = $this->_readInput();
|
||||
if (env('CONTENT_TYPE') === 'application/x-www-form-urlencoded') {
|
||||
parse_str($this->data, $this->data);
|
||||
}
|
||||
}
|
||||
if (ini_get('magic_quotes_gpc') === '1') {
|
||||
$this->data = stripslashes_deep($this->data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue