From 4209816d69fbc9c9ceb52b593bfaf297683eb74d Mon Sep 17 00:00:00 2001 From: Mo <35631697+modevelops@users.noreply.github.com> Date: Thu, 29 Dec 2022 15:23:52 +0100 Subject: [PATCH] PHP 8.1 fix for ctype_digit() deprecated error Fix for PHP 8.1 deprecated error: ctype_digit(): Argument of type int will be interpreted as string in the future in `bshaffer/oauth2-server-php/src/OAuth2/GrantType/JwtBearer.php` see https://www.php.net/manual/en/function.ctype-digit.php --- src/OAuth2/GrantType/JwtBearer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OAuth2/GrantType/JwtBearer.php b/src/OAuth2/GrantType/JwtBearer.php index 62c1efabd..2bcc1a035 100644 --- a/src/OAuth2/GrantType/JwtBearer.php +++ b/src/OAuth2/GrantType/JwtBearer.php @@ -127,7 +127,7 @@ public function validateRequest(RequestInterface $request, ResponseInterface $re } // Check expiration - if (ctype_digit($jwt['exp'])) { + if (ctype_digit((string)$jwt['exp'])) { if ($jwt['exp'] <= time()) { $response->setError(400, 'invalid_grant', "JWT has expired"); @@ -141,7 +141,7 @@ public function validateRequest(RequestInterface $request, ResponseInterface $re // Check the not before time if ($notBefore = $jwt['nbf']) { - if (ctype_digit($notBefore)) { + if (ctype_digit((string)$notBefore)) { if ($notBefore > time()) { $response->setError(400, 'invalid_grant', "JWT cannot be used before the Not Before (nbf) time");