Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Request class set post array values for put and patch methods also for REST api

givanze3f863dfdfb2
diff --git a/system/core/request.php b/system/core/request.php
index c49de45..565d204 100755
--- a/system/core/request.php
+++ b/system/core/request.php
@@ -60,7 +60,12 @@ class Request {
$this->request = $this->filter($this->request);
$this->cookie = $this->filter($this->cookie);
$this->files = $this->filter($this->files);
- $this->method = strtolower($_SERVER['REQUEST_METHOD'] ?? 'GET');
+ $this->method = strtolower($_SERVER['REQUEST_METHOD'] ?? 'get');
+
+ if ($this->method == 'put' || $this->method == 'patch') {
+ parse_str(file_get_contents('php://input'), $post);
+ $this->post = $this->filter($post, false);
+ }
$this->request = array_merge($this->request, $this->get, $this->post);
}