Skip to content

Commit e3f863d

Browse files
committed
Request class set post array values for put and patch methods also for REST api
1 parent 657aebd commit e3f863d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

system/core/request.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ final private function __construct() {
6060
$this->request = $this->filter($this->request);
6161
$this->cookie = $this->filter($this->cookie);
6262
$this->files = $this->filter($this->files);
63-
$this->method = strtolower($_SERVER['REQUEST_METHOD'] ?? 'GET');
63+
$this->method = strtolower($_SERVER['REQUEST_METHOD'] ?? 'get');
64+
65+
if ($this->method == 'put' || $this->method == 'patch') {
66+
parse_str(file_get_contents('php://input'), $post);
67+
$this->post = $this->filter($post, false);
68+
}
6469

6570
$this->request = array_merge($this->request, $this->get, $this->post);
6671
}

0 commit comments

Comments
 (0)