Skip to content

Commit 759dd7b

Browse files
committed
Add is_string validation
1 parent f47fce2 commit 759dd7b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Authenticator/RequestAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function authenticate(Request $request): bool
4444
$content = stream_get_contents($content);
4545
}
4646

47-
if (false === $content) {
47+
if (!is_string($content)) {
4848
throw new \InvalidArgumentException('Invalid JSON payload', Response::HTTP_BAD_REQUEST);
4949
}
5050

src/Controller/UserComAgreementsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __invoke(Request $request): Response
4242
$payload = stream_get_contents($payload);
4343
}
4444

45-
if (false === $payload) {
45+
if (!is_string($payload)) {
4646
return new JsonResponse('Invalid JSON payload', Response::HTTP_BAD_REQUEST);
4747
}
4848

0 commit comments

Comments
 (0)