@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | protected function formSpoofing(): void |
163 | 163 | { |
164 | - $post = $this->getRequestBody(); |
|
164 | + $post = $this->getRequestBody(); |
|
165 | 165 | |
166 | 166 | if (!empty($post['_method']) && in_array($post['_method'], ["PUT", "PATCH", "DELETE"])) { |
167 | 167 | $this->httpMethod = $post['_method']; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if (in_array($this->httpMethod, ["POST", "PUT", "PATCH", "DELETE"])) { |
175 | - $this->data = $this->getRequestBody(); |
|
175 | + $this->data = $this->getRequestBody(); |
|
176 | 176 | |
177 | 177 | unset($this->data["_method"]); |
178 | 178 | return; |
@@ -183,21 +183,21 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | protected function getRequestBody(): ?array |
186 | - { |
|
187 | - $headers = getallheaders(); |
|
186 | + { |
|
187 | + $headers = getallheaders(); |
|
188 | 188 | |
189 | - if (isset($headers['Content-Type']) && $headers['Content-Type'] === 'application/json') { |
|
190 | - if (!isset($_SERVER['CONTENT_LENGTH'])) { |
|
191 | - return []; |
|
192 | - } |
|
189 | + if (isset($headers['Content-Type']) && $headers['Content-Type'] === 'application/json') { |
|
190 | + if (!isset($_SERVER['CONTENT_LENGTH'])) { |
|
191 | + return []; |
|
192 | + } |
|
193 | 193 | |
194 | - $rawPost = file_get_contents("php://input", false, null, 0, $_SERVER['CONTENT_LENGTH']); |
|
194 | + $rawPost = file_get_contents("php://input", false, null, 0, $_SERVER['CONTENT_LENGTH']); |
|
195 | 195 | |
196 | - $jsonData = json_decode($rawPost, true); |
|
196 | + $jsonData = json_decode($rawPost, true); |
|
197 | 197 | |
198 | - return $jsonData; |
|
199 | - } |
|
198 | + return $jsonData; |
|
199 | + } |
|
200 | 200 | |
201 | - return filter_input_array(INPUT_POST, FILTER_DEFAULT); |
|
202 | - } |
|
201 | + return filter_input_array(INPUT_POST, FILTER_DEFAULT); |
|
202 | + } |
|
203 | 203 | } |