Skip to content

Commit

Permalink
fix: bug that if body is '0', $this->body will be null
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 7, 2023
1 parent 5e4e13b commit 05966db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ public function __construct($config, ?URI $uri = null, $body = 'php://input', ?U
$body = file_get_contents('php://input');
}

// If file_get_contents() returns false or empty string, set null.
if ($body === false || $body === '') {
$body = null;
}

$this->config = $config;
$this->uri = $uri;
$this->body = ! empty($body) ? $body : null;
$this->body = $body;
$this->userAgent = $userAgent;
$this->validLocales = $config->supportedLocales;

Expand Down

0 comments on commit 05966db

Please sign in to comment.