Skip to content

Commit

Permalink
implement missing changes from the code review
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Sep 9, 2023
1 parent d546a37 commit 1481461
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ private function removeTokenInRequest(RequestInterface $request): void
$request->setGlobal('post', $_POST);
} else {
$body = $request->getBody() ?? '';
if (! empty($json = json_decode($body)) && json_last_error() === JSON_ERROR_NONE) {
$json = json_decode($body);
if (! empty($json) && json_last_error() === JSON_ERROR_NONE) {
// We kill this since we're done and we don't want to pollute the JSON data.
unset($json->{$this->config->tokenName});
$request->setBody(json_encode($json));
Expand Down

0 comments on commit 1481461

Please sign in to comment.