Skip to content

Commit 6df127d

Browse files
Update system/Security/Security.php
Good idea to use built-in functions ;-) Co-Authored-By: Michal Sniatala <michal@sniatala.pl>
1 parent b09bfd2 commit 6df127d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Security/Security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function CSRFVerify(RequestInterface $request)
221221
$CSRFTokenValue = $_POST[$this->CSRFTokenName] ??
222222
(!is_null($request->getHeader($this->CSRFHeaderName)) && !empty($request->getHeader($this->CSRFHeaderName)->getValue()) ?
223223
$request->getHeader($this->CSRFHeaderName)->getValue() :
224-
(!empty(file_get_contents('php://input')) && !empty($json = json_decode(file_get_contents('php://input'))) && json_last_error() === JSON_ERROR_NONE ?
224+
(!empty($request->getBody()) && !empty($json = json_decode($request->getBody())) && json_last_error() === JSON_ERROR_NONE ?
225225
($json->{$this->CSRFTokenName} ?? null) :
226226
null));
227227

0 commit comments

Comments
 (0)