Skip to content

Commit 541a9f7

Browse files
authored
PHP 8.1 fix for ctype_digit() deprecated error (#1040)
1 parent ced9317 commit 541a9f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OAuth2/GrantType/JwtBearer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function validateRequest(RequestInterface $request, ResponseInterface $re
127127
}
128128

129129
// Check expiration
130-
if (ctype_digit($jwt['exp'])) {
130+
if (ctype_digit((string)$jwt['exp'])) {
131131
if ($jwt['exp'] <= time()) {
132132
$response->setError(400, 'invalid_grant', "JWT has expired");
133133

@@ -141,7 +141,7 @@ public function validateRequest(RequestInterface $request, ResponseInterface $re
141141

142142
// Check the not before time
143143
if ($notBefore = $jwt['nbf']) {
144-
if (ctype_digit($notBefore)) {
144+
if (ctype_digit((string)$notBefore)) {
145145
if ($notBefore > time()) {
146146
$response->setError(400, 'invalid_grant', "JWT cannot be used before the Not Before (nbf) time");
147147

0 commit comments

Comments
 (0)