From 0504410ee968119f73681c0f0c4af786a36ee5c5 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 5 Mar 2024 10:06:38 +0200 Subject: [PATCH] fix type check --- .../Core/Authentication/Jwt/SignatureVerifiers/Rsa.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/Authentication/Jwt/SignatureVerifiers/Rsa.php b/application/Espo/Core/Authentication/Jwt/SignatureVerifiers/Rsa.php index 1dfb68e3d9..ea89c4101b 100644 --- a/application/Espo/Core/Authentication/Jwt/SignatureVerifiers/Rsa.php +++ b/application/Espo/Core/Authentication/Jwt/SignatureVerifiers/Rsa.php @@ -120,6 +120,12 @@ class Rsa implements SignatureVerifier 'e' => new BigInteger('0x' . bin2hex(Util::base64UrlDecode($key->getE())), 16), ]); - return $publicKey->toString('PKCS8'); + $pem = $publicKey->toString('PKCS8'); + + if (!is_string($pem)) { + throw new RuntimeException(); + } + + return $pem; } }