Skip to content

Commit fab1e42

Browse files
committed
fix: PHP 8 strict type checking with null str functions
1 parent ef9dc14 commit fab1e42

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Controllers/ApiController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function init()
4040
exit;
4141
}
4242

43-
if (strpos($this->request->getHeader('Content-Type'), 'application/json') !== false) {
43+
$contentType = (string) $this->request->getHeader('Content-Type');
44+
45+
if (strpos($contentType, 'application/json') !== false) {
4446
$input = json_decode(file_get_contents("php://input"), true);
4547

4648
if ($input) {

0 commit comments

Comments
 (0)